Codes d’erreur

Learn more about common error codes.

Affirm uses HTTP response status codes to indicate the success or failure of your API requests. If your request fails, Affirm returns an error using the appropriate status code.

En général, il y a trois gammes de codes de statut auxquelles vous pouvez vous attendre :

👍

2xx success status codes confirm that your request worked as expected.

🚧

4xx error status codes indicate an error because of the information provided (e.g., a required parameter was omitted).

❗️

Les codes d'erreur 5xx sont rares et indiquent une erreur avec les serveurs d'Affirm.

Some 4xx errors that could be handled programmatically include an error code—a short string with a brief explanation—as a value for code. Below is a list of possible error codes that can be returned, along with additional information.

Codes d’erreurDescription
auth-declinedCharge authorization hold declined.
capture-greater-instrumentCannot capture charges on this instrument for more than the authorization hold amount.
capture-unequal-instrumentCannot capture charges on this instrument for an amount unequal to the authorization hold amount.
capture-voidedCannot capture voided charge.
partial-capture-instrumentCannot partially capture charges on this instrument.
refund-exceededExceeded maximum refund.
refund-uncapturedImpossible de rembourser des frais qui n'ont pas été saisis.
refund-voidedCannot refund a voided charge.
capture-declinedCharge capture declined.
capture-limit-exceededExceed maximum capture amount on charge.
expired-authorizationCannot capture a charge with an expired authorization hold.
refund-expiredCharges on this instrument must be refunded within N days of capture.
invalid_fieldAn input field resulted in invalid request.
public-api-key-not-specifiedPlease provide a public API key.
public-api-key-invalidPlease provide a valid public API key.
public-api-key-wrong-environmentPlease provide a live public API key when not using the sandbox environment.
public-api-key-inactivePlease provide an active public API key.
api-key-pair-not-specifiedPlease provide an API key pair.
private-api-key-invalidPlease provide a valid private API key.
api-key-pair-wrong-environmentPlease provide a live API key pair when not using the sandbox environment.
api-key-pair-inactivePlease provide an active API key pair.
not_foundCould not find the resource(s) specified in the request.