Skip to main content
POST
/
api
/
pay
/
{projectId}
/
companyProjectCreditCardPaymentsInfo
/
{id}
/
recreate
Recreate Payment Token
curl --request POST \
  --url https://localhost:44371/api/pay/{projectId}/companyProjectCreditCardPaymentsInfo/{id}/recreate \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{}'
{
  "success": true,
  "code": 200,
  "errorMessage": null,
  "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}

Description

Updates stored payment information by recreating the payment token with new card details. Used when customers update expired cards or change payment methods.

Input

  • Path Parameter: projectId (guid, required) — Project identifier for authentication.
  • Path Parameter: id (guid, required) — Payment information ID to update.
  • Body: model (CompanyProjectCreditCardPaymentInfoReCreateCommandRequest, required) — Updated card information.

Output

Returns a CompanyProjectCreditCardPaymentInfoReCreateCommandResponse containing the new payment token.

Example Request

POST /api/payment/{projectId}/credit-card-payment-info/{id}/recreate
Content-Type: application/json
X-API-Key: {your-api-key}

{
  "cardNumber": "4111111111111111",
  "expirationMonth": "03",
  "expirationYear": "2026",
  "cvv": "456"
}

Example Response

{
  "success": true,
  "code": 200,
  "paymentToken": "tok_9876543210fedcba"
}

Errors

  • 400 Bad Request — Invalid card data.
  • 404 Not Found — Payment information ID not found.

Notes

  • Original token is replaced with new token.
  • Subscriptions using old token should be updated to use new token.

Authorizations

Authorization
string
header
required

The access token received from the authorization server in the OAuth 2.0 flow.

Path Parameters

projectId
string<guid>
required

The project identifier for authentication.

id
string<guid>
required

The payment information ID to recreate/update.

Body

application/json

The updated card information or new token details.

Base structure for command requests that modify data. Represents the payload used to refresh an existing payment profile with updated card or address details.

creditCard
object

At least one of the properties - CreditCard/PersonAddress - is required

personAddress
object

At least one of the properties - CreditCard/PersonAddress - is required

Response

Always returned. Check the success property in the response body to determine if the operation succeeded.

Standard response structure containing operation status and error information. Standard command response indicating the result of a data modification. Create response containing the identifier of the newly created entity. Represents the response returned after refreshing an existing payment profile.

success
boolean

True if the operation completed successfully; false if an error occurred.

Example:

true

code
enum<string>

Result code indicating the outcome of the operation.

Available options:
Unknown,
Success,
BadRequest,
Unauthorized,
NotFound,
Error
Example:

200

errorMessage
string | null

Human-readable error message when an error occurs.

Example:

null

id
string<guid>

Unique identifier of the newly created entity.

Example:

"3fa85f64-5717-4562-b3fc-2c963f66afa6"