API references

Rehydrate a card security code

This endpoint attaches a newly collected security code to a saved card's token, so the token can be used for a customer-initiated payment (CIT). It returns the same token.

The security code is never saved with the card. It covers only the payment made right after it's entered, so every customer-initiated payment on a saved card needs a newly entered security code:

  1. Collect the security code from the customer.
  2. Call rehydrate-card with the saved card's token and the security code.
  3. Right after, call select-payment-method with the same token and start the payment.

If the payment fails, collect the security code and call this endpoint again before retrying.

The browser SDK calls this endpoint for you in saved-card mode. Merchant-initiated payments (MIT) through the merchant request-payment endpoint don't need it.

Endpoint signature
POST https://api.reservepay.com/sdk/rehydrate-card HTTP/1.1
Content-Type: application/json
Accept: application/json
{
merchant_id: string,
security_code: string,
token: string,
}
Returns: string
New to Reservepay? Read our guide on how to call endpoints to get started.
Request arguments
merchant_id string

Required. Your merchant ID that uniquely identifies your account.

security_code string

Required. The card's security code (CVV/CVC). This is typically a 3-digit number on the back of the card, or 4 digits on the front for American Express.

token string

Required. The saved card's token.

Errors specific to this endpoint
NOT_FOUND

This error occurs when we cannot find the merchant account with the IDs provided. Double check that you are using the correct IDs.

Errors common to all endpoints
UNHANDLED_ERROR

This error occurs when the server encounters an unexpected internal error that it cannot handle gracefully. This typically happens due to bugs, infrastructure issues, or edge cases that weren't anticipated during development.

INVALID_ARGUMENTS

This error occurs when the request contains invalid or missing parameters. Common cases include missing required fields, or values that don't match the expected format or type.

BAD_VERSION

This error occurs when making requests to an API version that is either deprecated or not yet released. This commonly happens when using an outdated SDK or when the API version specified in the request URL is incorrect.

CODE SAMPLES
curl
curl "https://api.reservepay.com/sdk/rehydrate-card" \
  -X POST
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{
        "merchant_id": "123456789012",
        "security_code": "123",
        "token": "IC3949UCOE6U93"
      }'
Learn how to run these code samples in your terminal by reading our guide.