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

Description

Tokenizes and stores credit card information for future use in recurring billing, subscriptions, or one-click checkout. Card data is securely tokenized and never stored in plain text. Returns a payment token that can be used for subsequent transactions without requiring card details again.

Input

  • Path Parameter: projectId (guid, required) — Project identifier for authentication.
  • Body: model (CompanyProjectCreditCardPaymentInfoCreateCommandRequest, required) — Payment information including card details.

Output

Returns a CompanyProjectCreditCardPaymentInfoCreateCommandResponse containing the payment token or error information.

Example Request

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

{
  "cardNumber": "4111111111111111",
  "expirationMonth": "12",
  "expirationYear": "2025",
  "cvv": "123",
  "cardholderName": "John Smith"
}

Example Response

{
  "success": true,
  "code": 200,
  "errorMessage": null,
  "paymentToken": "tok_1234567890abcdef"
}

Errors

  • 400 Bad Request — Invalid card data (card number, CVV, or expiration date).
  • 404 Not Found — Specified project ID does not exist.
  • 401 Unauthorized — Invalid or missing API key.

Notes

  • Card data is tokenized immediately and original details are not stored.
  • Returned token should be stored securely for future transaction processing.

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 and authorization.

Body

application/json

The payment information including card details or existing token to store.

Base structure for command requests that modify data. Represents the payload used to create a new credit card payment profile for a project.

creditCard
object
required

The credit card details being stored.

personAddress
object
required

The cardholder's personal and address information.

securedProperties
string[] | null

The collection of secured property paths that require encryption handling.

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 creating a credit card 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"