Skip to main content
POST
/
customers
/
{customer_id}
/
payment-methods
curl --request POST \
  --url https://api-sandbox.y.uno/v1/customers/{customer_id}/payment-methods \
  --header 'Content-Type: application/json' \
  --header 'X-Idempotency-Key: <api-key>' \
  --header 'private-secret-key: <api-key>' \
  --header 'public-api-key: <api-key>' \
  --data '
{
  "account_id": "dbf0c133-86bc-4be0-94a5-ca2ff6778451",
  "country": "US",
  "type": "CARD",
  "callback_url": "www.google.com",
  "workflow": "DIRECT",
  "card_data": {
    "holder_name": "John Doe",
    "expiration_month": 3,
    "expiration_year": 26,
    "number": "4111111111111111",
    "security_code": "123"
  },
  "customer_payer": {
    "document": {
      "document_type": "SSN",
      "document_number": "123-45-6789"
    }
  }
}
'
{
  "idempotency_key": "2ca58c6d-8794-4c8f-a2f6-bba4b7498b74",
  "name": "VISA ****1111",
  "description": "VISA ****1111",
  "type": "CARD",
  "category": "CARD",
  "country": "US",
  "status": "ENROLLED",
  "sub_status": null,
  "vaulted_token": "cbdcc878-ceb4-4dd8-b0f0-49d444855de0",
  "callback_url": "www.example.com",
  "action": null,
  "created_at": "2024-06-06T13:32:49.715656Z",
  "updated_at": "2024-06-06T13:32:49.715656Z",
  "card_data": {
    "iin": "41111111",
    "lfd": "1111",
    "expiration_month": 3,
    "expiration_year": 26,
    "number_length": 16,
    "security_code_length": 3,
    "brand": "VISA",
    "issuer": "JPMORGAN CHASE BANK N A",
    "issuer_code": null,
    "category": "CREDIT",
    "type": "CREDIT",
    "fingerprint": "55a7fe38-cdc3-45dc-8c5f-820751799c76"
  },
  "last_successfully_used": null,
  "last_successfully_used_at": null,
  "preferred": null,
  "verify": {
    "vault_on_success": false,
    "payment": null
  }
}
This request enrolls a payment method for a customer. With the information provided by Yuno after the customer selects the payment method to enroll, you will be able to save that information for future purchases using the payment method object created. Check the Available payment methods in Yuno. You’ll need to set your credentials for each payment method in the Yuno dashboard in order to to be able to use them. Note that this request requires an X-Idempotency-Key. Check the Authentication page for more information.
WebhooksWe recommend listening to Webhooks to stay up to date with the state of the enrolled payment methods of your customers.
If a customer enrolls the same card multiple times, Yuno creates a new enrollment each time and returns a distinct vaulted_token. Use the card fingerprint in the enrollment response to detect duplicates on your side (the fingerprint may be null for some providers). See Card Fingerprint.
Only available for PCI certified merchants.

Authorizations

public-api-key
string
header
default:<Your public-api-key>
required
private-secret-key
string
header
default:<Your private-secret-key>
required
X-Idempotency-Key
string
header
default:<Your X-Idempotency-Key>
required

Path Parameters

customer_id
string
required

The unique identifier of the customer, created using the Create Customer endpoint (MAX 64; MIN 36).

Body

application/json
account_id
string
required

The unique identifier of the account. You find this information on Yuno's Dashboard (MAX 64; MIN 36).

country
enum<string>
required

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

Available options:
AR,
BO,
BR,
CL,
CO,
CR,
EC,
SV,
GT,
HN,
MX,
NI,
PA,
PY,
PE,
US,
UY,
type
enum<string>
required

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

Available options:
CARD,
NU_PAY_ENROLLMENT
workflow
enum<string>
default:DIRECT

The payment workflow indicates whether the integration will use Yuno's SDK or will be a back to back connection. Since you are in the Direct workflow, the value must be DIRECT.

Available options:
DIRECT
provider_data
object

Specifies the provider_data object. This object should only be sent if the merchant requires a token migration process and as long as this has already been agreed with your commercial advisor in Yuno.

card_data
object

Specifies the details of the card. Only for DIRECT workflow integration.

callback_url
string

URL to return the customer after an enrollment in a provider´s environment. Only necessary for alternative payment methods integrations (MAX 255; MIN 3).

verify
object

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.

Response

200

idempotency_key
string
Example:

"2ca58c6d-8794-4c8f-a2f6-bba4b7498b74"

name
string
Example:

"VISA ****1111"

description
string
Example:

"VISA ****1111"

type
string
Example:

"CARD"

category
string
Example:

"CARD"

country
string
Example:

"US"

status
string
Example:

"ENROLLED"

sub_status
any
vaulted_token
string
Example:

"cbdcc878-ceb4-4dd8-b0f0-49d444855de0"

callback_url
string
Example:

"www.example.com"

action
any
created_at
string
Example:

"2024-06-06T13:32:49.715656Z"

updated_at
string
Example:

"2024-06-06T13:32:49.715656Z"

card_data
object
last_successfully_used
any
last_successfully_used_at
any
preferred
any
verify
object