Update saved payment details
Integrate with our API to update a customer’s saved payment details. Our API has two endpoints to update payment details represented by a secure token:
- Update saved payment details – Use our Update Secure Token endpoint if you are sending the raw payment details, for example, if you are updating a card’s expiry date or a billing address.
- Update saved payment details with a single-use token – Use our Update Account Details endpoint if you have a single-use token that represents updated payment details, for example, if you have a single-use token from Hosted Fields.
Note: To update saved payment details, you need the ID of the secure token that represents the payment details. If you don’t know the ID, go to List Secure Tokens.
Before you begin
Bearer tokens
Use our Identity Service to generate a Bearer token to include in the header of your requests. To generate your Bearer token, complete the following steps:
- Include your API key in the x-api-key parameter in the header of a POST request.
- Send your request to https://identity.payroc.com/authorize.
Note: You need to generate a new Bearer token before the previous Bearer token expires.
Example request
Example response
If your request is successful, we return a response that contains your Bearer token, information about its scope, and when it expires.
Headers
To create the header of each POST request, you must include the following parameters:
- Content-Type: Include application/json as the value for this parameter.
- Authorization: Include your Bearer token in this parameter.
- Idempotency-Key: Include a UUID v4 to make the request idempotent.
Errors
If your request is unsuccessful, we return an error. For more information about errors, see Errors.
Update saved payment details
Use the Update Secure Token method if you have the raw information that a customer wants to update. You can update the following payment details:
- Sensitive payment details, including:
- Card - Cardholder name and expiry date
- ACH - Accountholder name and account type
- PAD - Accountholder name and institution number
- MIT agreement
- Customer’s contact details
- Customer’s address details
Integration steps
- Update a secure token
Update a secure token
To update the payment details represented by a secure token, send a PATCH request to our Update Secure Token endpoint.
Note: The request format follows the RFC 6902 standard.
Request parameters
To create the body of your request, use the following parameters:
Request
Example request
Response fields
If your request is successful, we update the secure token and return the details represented by the secure token.
Response
Example response
Update saved payment details with a single-use token
If you use our Hosted Fields solution, our gateway creates a single-use token to represent the customer’s updates to their card, ACH, or PAD details. Send the single-use token to our gateway so that we can update the details represented by the secure token.
You can also send a secondary request to our gateway to update other details that the single-use token doesn’t change:
- MIT agreement
- Customer’s contact details
- Customer’s address details
Integration steps
Step 1. Update saved payment details with a single-use token
Step 2. (Optional) Update a secure token
Step 1. Update saved payment details with a single-use token
To update saved payment details with a single-use token, send a POST request to our Update Account Details endpoint.
Request parameters
To create the body of your request, use the following parameters:
Request
Example request
Response fields
If your request is successful, we update the secure token and return the details represented by the secure token.
Response
Example response
Step 2. (Optional) Update a secure token
To update the payment details represented by a secure token, send a PATCH request to our Update Secure Token endpoint.
Note: The request format follows the RFC 6902 standard.
Request parameters
To create the body of your request, use the following parameters:
Request
Example request
Response fields
If your request is successful, we update the secure token and return the details represented by the secure token.