Skip to content
On this page

Guides

Errors

What Payjar returns when a key, field, or payment is not valid, and what to do next.

Payjar business errors use the normal envelope and a 4xx status.

HTTPMessageWhat to do
401Invalid API key.Check the key, the Bearer prefix, and that the key has not been replaced.
403This profile is not active.The store is switched off.
403This profile is not live yet.You used a live key before the store went live. Use a test key, or go live first.
400A valid customer email is required.Send email or customer_email.
400reference is required.The simulate call needs reference.
400Payment not found.That reference is not on this store, in this test or live mode. HTTP 404 on verify.
400This payment has expired.Start a new payment, or call initialize again with the same unpaid reference to get a new 30 minutes.
400Payments can only be simulated in test mode.Use sk_test_....
400No settlement account is available for this profile yet.The store cannot receive a transfer yet.
400Could not generate a payment account. Please try again.Payjar could not open an account number. Try the request again.
400This profile has been suspended.The store cannot take payments.
404Payment not found.Verify was called with an unknown reference.
422Validation messageA field is missing or invalid. See below.
429Too many requestsStay under 60 requests a minute per IP.

Validation error#

HTTP 422 uses a different shape. There is no success field.

Request

{
  "amount": 0
}

422Response

{
  "message": "The amount field must be at least 1.",
  "errors": {
    "email": [
      "The email field is required when customer email is not present."
    ],
    "amount": [
      "The amount field must be at least 1."
    ]
  }
}

The popup shows errors text in the modal and calls onError.

SituationWhat happens
No public key and no access_codeModal shows A valid Payjar public key is required.
Bad keyModal shows Invalid API key.
Payjar cannot create the sessionModal shows the message from Payjar.
Customer closes the windowonClose runs. The payment can still succeed later.
Timer runs outonClose runs. Status becomes expired.