Payment Accounts API
This API allows managing payment accounts for customers. It provides endpoints to create, read, and manage accounts and payment references.
Payment accounts function as a unique or universal account for a customer, with multiple payment references to accept payments for credits/loans through different methods. Currently, two payment providers are supported:
- DAPP: For cash payments through physical stores
- STP: For electronic bank transfers
The CMS Base URL is used (see introduction).
Table of Contents
- The Account Object
- The AccountReference Object
- Payment Account Operations
- Status Values
- Supported Providers
The Account Object
The Account Object represents an account for receiving payments from different sources and methods.
Attributes
| Attribute | Description | Type |
|---|---|---|
accountId | Unique identifier of the account | String (UUID) |
accountHolder | Account holder information | Object |
references | List of payment references associated with the account | Array |
createdAt | Account creation date | String (Datetime) |
updatedAt | Date of the last account update | String (Datetime) |
Nested Object Details
accountHolder Object
| Attribute | Description | Type |
|---|---|---|
name | Account holder's name | String |
phone | Account holder's phone number (optional) | String |
email | Account holder's email (optional) | String |
partnerId | Partner identifier managing the account | String (UUID) |
clientId | Client identifier | String (UUID) |
The AccountReference Object
The AccountReference object represents a payment reference associated with an account.
| Attribute | Description | Type |
|---|---|---|
accountReferenceId | Unique identifier of the reference | String (UUID) |
gatewayId | Payment gateway identifier | String (UUID) |
provider | Payment service provider (see providers table) | String |
status | Payment reference status (see reference statuses) | String |
amount | Amount associated with the reference (optional) | Object |
reference | Reference code for making the payment | String |
createdAt | Reference creation date | String (Datetime) |
updatedAt | Reference update date | String (Datetime) |
expirationAt | Reference expiration date (optional) | String (Datetime) |
amount Object
| Attribute | Description | Type |
|---|---|---|
amount | Numeric amount | Number |
currency | Currency code (e.g., MXN) | String |
Payment Account Operations
Create Payment Account
Creates a payment account for a specific customer.
Input Parameters
| Parameter | Description | Type | Required |
|---|---|---|---|
partnerId | Partner identifier managing the account | String (UUID) | Yes |
clientId | Client identifier | String (UUID) | Yes |
customerName | Customer's name | String | No |
customerPhone | Customer's phone number | String | No |
customerEmail | Customer's email | String | No |
autoCreateReferences | Automatically create references for configured payment methods | Boolean | No |
Request Body
Successful Response (201)
The response includes a created Account object with its payment references.
Specific Errors
| Response Code | Description |
|---|---|
| 400 | Invalid request. This may occur if required parameters are missing or if the provided values are not valid. |
| 404 | The client or partner does not exist |
| 409 | An account already exists for the specified customer |
Get Payment Account
Retrieves the information of a payment account for a specific customer.
Path Parameters
| Parameter | Description | Type | Required |
|---|---|---|---|
client-id | Client identifier | String (UUID) | Yes |
Successful Response (200)
The response includes an Account object with all its information and payment references of type AccountReference.
Specific Errors
| Response Code | Description |
|---|---|
| 400 | Invalid request. This may occur if the provided values are not valid. |
| 404 | The account does not exist for the specified customer. |
Get Payment References
Retrieves the payment references associated with a specific customer account.
Path Parameters
| Parameter | Description | Type | Required |
|---|---|---|---|
client-id | Client identifier | String (UUID) | Yes |
Query Parameters
| Parameter | Description | Type | Required |
|---|---|---|---|
status | Filter by reference status | String | No |
provider | Filter by reference provider | String | No |
Successful Response (200)
The response includes an array of AccountReference objects associated with the customer's account.
Specific Errors
| Response Code | Description |
|---|---|
| 400 | Invalid request. This may occur if the provided values are not valid. |
| 404 | The account does not exist for the specified customer. |
Create Payment Reference
Creates a new payment reference for an existing account.
Path Parameters
| Parameter | Description | Type | Required |
|---|---|---|---|
client-id | Client identifier | String (UUID) | Yes |
Input Parameters
| Parameter | Description | Type | Required |
|---|---|---|---|
provider | Payment service provider (dapp, stp) | String | No |
gatewayId | Payment gateway identifier | String (UUID) | No |
amount | Amount associated with the reference | Object | No |
durationDays | Duration in days of the reference's validity | Integer | No |
Request Body
The request body must contain the necessary details to create a payment reference.
Successful Response (201)
The response includes an array of created AccountReference objects:
Specific Errors
| Response Code | Description |
|---|---|
| 400 | Invalid request. This may occur if required parameters are missing or if the provided values are not valid. |
| 404 | The account does not exist. |
| 409 | A reference with the same parameters already exists. |
| 422 | Unprocessable entity. Error in processing the request. |
Status Values
Reference Statuses
Possible values for the status field in payment references:
| Status | Value | Description |
|---|---|---|
Active | "ACTIVE" | The reference is active and can receive payments |
Cancelled | "CANCELLED" | The reference has been cancelled |
Expired | "EXPIRED" | The reference has expired |
Supported Payment Providers
Possible values for the provider field in payment references:
| Provider | Value | Description |
|---|---|---|
| DAPP | "dapp" | Cash payments through physical stores |
| STP | "stp" | Electronic bank transfers |