Customers

Add card to customer

Changed on

Adds a card to a customer. The behaviour depends on payin_type:

  • DCP, DCP_AUTH: tokenizes a card. The response includes a tokenization_link the customer must visit to enter the card details.
  • STRIPE: issues a virtual card against wallet_id. See Stripe Authorization.
  • M2P_ISSUING (only when card issuing is enabled): issues a card linked to a wallet previously created with POST /wallets and type: M2P_ISSUING. Issuance is asynchronous: the card is returned with confirmed: false and becomes confirmed: true, with the issuer token in gateway_reference_id, once the issuer confirms it.
post/customers/{uuid}/cards

Request

  • Base URL
    https://your-subdomain.truust.io/2.0
  • URL
    https://your-subdomain.truust.io/2.0/customers/{uuid}/cards
  • Auth
    HTTP bearer

Path parameters

uuidstring required

Customer UUID.

Request body

payin_type'DCP' | 'DCP_AUTH' | 'STRIPE' | 'M2P_ISSUING' required
wallet_idinteger

ID of the wallet that backs the card. Required for STRIPE and M2P_ISSUING. Must belong to the customer.

product_idstring

M2P_ISSUING only. Card product identifier.

card_typestring

M2P_ISSUING only. Card type or program code.

Example request

{
  "payin_type": "M2P_ISSUING",
  "wallet_id": 51
}

Response

Card created

idinteger
selfstring
uuidstring
typestring nullable

Card brand (e.g. VISA, MASTERCARD).

cardholderstring nullable
aliasstring nullable

Masked card number alias (e.g. 4242XXXXXXXX4242).

expirationstring nullable
issuing_countrystring nullable
issuing_bankstring nullable
is_3d_secureboolean nullable
confirmedboolean

Whether the card has been successfully tokenized and confirmed.

payin_typestring nullable

Payment type this card is associated with.

tokenization_linkstring uri nullable

URL to complete card tokenization. Only present immediately after creation.

gateway_reference_idstring nullable

Identifier of the card at the issuer (STRIPE, M2P_ISSUING). Only present for cards linked to a wallet.

created_atstring date-time nullable
connectionsConnections

Hypermedia links to related resources.

Example response

{
  "expiration": "12/26"
}

Changes