Skip to main content

Error Handling

When something goes wrong, we'll give you a clear error response that tells you what happened and why. Every error follows the same shape, so you can handle them consistently.

What errors look like

{
"status": 400,
"errorCode": "yp_2002",
"message": "Request validation failed",
"errorType": "validation"
}
FieldTypeWhat it is
statusintegerThe HTTP status code.
errorCodestringA Yeti error code like yp_2002. Use this in your code to handle specific errors.
messagestringA human-readable explanation. For validation errors, this will tell you which fields have problems.
errorTypestringThe category: security, validation, internal, or configuration.

All the error codes

Security (yp_1xxx)

Something's up with authentication or authorisation.

CodeStatusMessageWhat it means
yp_1001401UnauthorizedYour API key is missing, invalid, or expired.
yp_1002403ForbiddenThe key's fine, but it's not allowed to access this endpoint.

Validation (yp_2xxx, yp_3xxx)

There's a problem with the request or with something it references.

CodeStatusMessageWhat it means
yp_2001400Bad requestThe request doesn't make sense to us.
yp_2002400Request validation failedOne or more fields aren't right. Check the message for specifics.
yp_3001404Resource not foundWhatever you're looking for doesn't exist.
yp_3002404Merchant not foundWe can't find a merchant linked to your API key.
yp_3003404Site not foundThe siteId in your URL doesn't match any site we know about.
yp_3004409Request not allowed for this site typeThe site exists, but it's not set up as an ecommerce site.
yp_3004404Site cannot be foundWe couldn't find the site during setup.
yp_3005404Merchant not foundWe couldn't find the merchant during setup.

Payment processing (yp_4xxx)

Something went wrong while talking to the payment processor.

CodeStatusMessageWhat it means
yp_4001500Payment processing failedA general payment failure.
yp_4002500Failed to retrieve payment methodsWe couldn't get the payment methods.
yp_4003500Failed to capture paymentThe capture didn't go through.
yp_4004500Failed to submit payment detailsWe couldn't submit the 3DS details.
yp_4005500Failed to refund or cancel paymentThe reversal didn't work.
yp_4006500Failed to start paymentWe couldn't start the payment.
yp_4007500Failed to update authorised amountThe amount update didn't go through.
yp_4008500Failed to create sessionWe couldn't create the checkout session.

Configuration (yp_5xxx)

Something's not set up right on your account.

CodeStatusMessageWhat it means
yp_5001404Configuration not foundA piece of configuration we need is missing.
yp_5003422Merchant is not properly configuredYour merchant account isn't set up for ECOM payments yet. Get in touch with support.

Gateway (yp_9xxx)

These come from the API gateway before your request even reaches us.

CodeStatusMessageWhat it means
yp_9001500Internal server errorSomething unexpected happened at the gateway.
yp_9002400Bad requestThe gateway couldn't make sense of the request.
yp_9003401UnauthorizedAuthentication failed at the gateway.
yp_9004401UnauthorizedAccess denied at the gateway.
yp_9005404Not foundThat endpoint doesn't exist. Double-check the URL.
yp_9006429Too many requestsYou're sending too many requests. Slow down and try again in a bit.

Common problems and how to fix them

Getting a 401?

  • Check the Authorization header is there and looks like Bearer YOUR_API_KEY.
  • Make sure the key hasn't been turned off or expired.
  • If you're on the test environment, check you're using a test key (and vice versa for production).

Getting a 403?

  • Your key is valid, but it isn't allowed to access this endpoint.
  • If the error code is yp_1002 and you're sure your setup is correct, check that your merchant's ECOM checkout key is configured.

Getting a 400 with yp_2002?

  • The message field will tell you exactly which fields have problems. Common culprits:
    • Missing amount (most endpoints need it, with both value and currency).
    • returnUrl isn't a valid URL.
    • reference is longer than 80 characters.

Getting a 404 for a site or merchant?

  • Double-check the siteId in your URL matches an ecommerce site on your merchant account.
  • The site needs to be set up as type Ecommerce -- other types won't work here.

Getting a 422?

  • Your merchant account needs to be configured for ECOM payments. Get in touch with your account manager or support to sort this out.

Getting a 429?

  • You're being rate limited. Wait a moment and try again. Have a look at Best Practices for how to handle this properly.

Getting a 500?

  • These usually mean something went wrong with the payment processor. They're often temporary.
  • Try the request again with the same idempotency key.
  • If it keeps happening, get in touch with support and include the error code and your request details.