Enroll Payment Method

This request enrolls a payment method for a customer. With the information provided by WHITELABEL after the customer selects the payment method to enroll, you will be able to save it for future purchases in the payment method object created.

Note that this request requires an X-Idempotency-Key. Check the Authentication.

Webhooks

We recommend listening to Webhooks to stay up to date with the state of the enrolled payment methods of your customers.

In case a customer enrolls the same card twice but with new expiration date or cardholder info, we will unenroll the previously enrolled card and keep the new one.

Available payment methods for enrollment

The following payment methods can be enrolled using this endpoint:

Payment MethodType
CardsCARD
NupayNU_PAY_ENROLLMENT
PayPalPAYPAL_ENROLLMENT
DaviplataDAVIPLATA_ENROLLMENT
MercadoPago WalletWALLET_CONNECT
dLocal YapeYAPE_ENROLLMENT
dLocal Smart PIXSMART_PIX
AstropayASTROPAY_ENROLLABLE
Adyen PIX BiométricoPIX_BIOMETRICO

Payment Method Availability

When you retrieve the payment methods available to enroll, only the ones which you have connected, created a route, and added to your checkout will be present. For more information about enrollment workflows, see the Enroll Payment Methods guide.

POST/customers/sessions/{customer_session}/payment-methods

Path Parameters

customer_sessionstringrequired

The customer session that has been created for the enrollment using the Create Customer Session endpoint (UUID, 36 chars).

Body application/json

account_idstringrequired

The unique identifier of the account. You find this information on the WHITELABEL dashboard (UUID, 36 chars).

payment_method_type"CARD" | "MERCADO_PAGO_WALLET" | "NEQUI" | "BANCOLOMBIA_TOKENBOX" | "NU_PAY_ENROLLMENT"required

The payment method type (MAX 255; MIN 3; Payment Type List).

country"AR" | "BO" | "BR" | "CL" | "CO" | "CR" | "EC" | "SV" | "GT" | "HN" | "MX" | "NI" | "PA" | "PY" | "PE" | "US" | "UY"required

The transaction’s country code (MAX 2; MIN 2; ISO 3166-1).

account_updaterboolean

Per-card control for Card Account Updater. When set to false, this card is excluded from Card Account Updater and will not receive automatic card-detail updates. When omitted, the card follows your account’s Account Updater configuration. Applies at enrollment.

verifyobject

Indicates whether to verify the payment with a verify transaction or not. You’ll need to have a provider defined in your CARD route. False by default. Access the Card Verification page for more details.

Show verify properties
vault_on_successbooleanrequired

Indicates whether to verify the payment with a verify transaction or not. You’ll need to have a provider defined in your CARD route. False by default.

currencystring

Currency of the card verification. For a full list of currency codes, see Country reference (MAX 3; MIN 3; ISO 4217).

Response

201

idstring
account_idstring
namestring
descriptionstring
typestring
categorystring
countrystring
statusstring
created_atstring
updated_atstring
enrollmentobject
Show enrollment properties
sessionstring
sdk_required_actionboolean
providerobject
Show provider properties
idstring
typestring
provider_statusany
customer_payerobject
Show customer_payer properties
first_namestring
last_namestring
emailstring
genderstring
date_of_birthstring
documentobject
Show document properties
document_numberstring
document_typestring
phoneobject
Show phone properties
numberstring
country_codestring
billing_addressobject
Show billing_address properties
address_line_1string
address_line_2string
countrystring
statestring
citystring
zip_codestring
verifyobject
Show verify properties
vault_on_successboolean
paymentany
preferredany

400

codestring
messagesstring[]

401

codestring
messagesstring[]

403

codestring
messagesstring[]
Request
curl -X POST "https://api-sandbox.whitelabel.com/v1/customers/sessions/<customer_session>/payment-methods" \
  -H "Content-Type: application/json" \
  -H "public-api-key: <public-api-key>" \
  -H "private-secret-key: <private-secret-key>" \
  -H "X-Idempotency-Key: <X-Idempotency-Key>" \
  -d '{
  "account_id": "string",
  "payment_method_type": "CARD",
  "country": "AR",
  "account_updater": true,
  "verify": {
    "vault_on_success": true,
    "currency": "string"
  }
}'
Response
{
  "id": "0395199e-a99c-4a85-acac-6c916f43fa74",
  "account_id": "493e9374-510a-4201-9e09-de669d75f256",
  "name": "Visa Credit Card",
  "description": "Visa Credit Card",
  "type": "VISA",
  "category": "CARD",
  "country": "US",
  "status": "READY_TO_ENROLL",
  "created_at": "2024-06-06T13:14:18.799434Z",
  "updated_at": "2024-06-06T13:14:18.799437Z",
  "enrollment": {
    "session": "6641e30d-ca7a-440f-b97c-24231eac6dab",
    "sdk_required_action": false
  },
  "provider": {
    "id": "YUNO",
    "type": "YUNO",
    "provider_status": null
  },
  "customer_payer": {
    "first_name": "John",
    "last_name": "Doe",
    "email": "john.doe@email.com",
    "gender": "M",
    "date_of_birth": "1990-02-28",
    "document": {
      "document_number": "123456789",
      "document_type": "SSN"
    },
    "phone": {
      "number": "1234567890",
      "country_code": "1"
    },
    "billing_address": {
      "address_line_1": "123 Main St",
      "address_line_2": "Apt 4B",
      "country": "US",
      "state": "NY",
      "city": "New York",
      "zip_code": "10001"
    }
  },
  "verify": {
    "vault_on_success": false,
    "payment": null
  },
  "preferred": null
}