Our documentation has moved!

You are currently viewing a legacy version of our help articles.
For the most up-to-date version, please use the new Chargify Help & Support Site.
Follow

API Change For "invalid referral code" errors

A change was made today that will affect API v2 users. When creating a new subscription via API v2, and passing an invalid error code, the validation error will now have the attribute of "ref", as follows:

{
"result" => {
   "status_code" => "422",
   "result_code" => "4000",
   "errors" => [
     {
       "attribute" => "ref",
       "message" => "Referral code is invalid."
     }
   ]
 },
 "meta" => {
   "status_code" => "422",
   "result_code" => "4000",
   "errors" => [
     {
       "attribute" => "ref",
       "message" => "Referral code is invalid."
     }
   ]
 }
}

Previously, this validation error had the attribute of "base".

Was this article helpful?
1 out of 1 found this helpful
Have more questions? Submit a request

1 Comments

  • 0
    Avatar
    Kyle Clarke

    #winning

    Thanks for updating this. Much much easier than parsing error messages with the attribute of "base".

Please sign in to leave a comment.
Powered by Zendesk