Skip to content

Create scheme token

Request

Request to create a scheme token, representing payment data according to scheme rules.

Path
ownerIdstring, [ 0 .. 20 ] charactersrequired

The identifier of the vault owner. This must match the owner type. For example, provide your merchant group ID when ownerType is MerchantGroup.

Example:MERCHANT-GROUP-1
ownerTypestringrequired

The type of entity that owns the token vault. Use with ownerId to identify which vault to use.

Enum:"Referrer""MerchantGroup""Merchant""Site"
Example:MerchantGroup
Bodyapplication/json
cardobjectrequired

Details about the card for tokenisation.

customerConsentobject

Optional details about the customer's consent to store their payment card. Include this when you create the token if you might need to revoke consent later.

curl -i -X POST \
  https://api-services.pxp.io/api/v1/token-vault/MerchantGroup/MERCHANT-GROUP-1/vaults/scheme-tokens \
  -H 'Content-Type: application/json' \
  -d '{
    "card": {
      "primaryAccountNumber": "4111111111111111",
      "expiryMonth": "03",
      "expiryYear": "2025",
      "holderName": "Mr John Doe",
      "cardVerificationCode": "123"
    },
    "customerConsent": {
      "hasCustomerConsent": true,
      "merchantId": "MERCHANT-001",
      "merchantShopperId": "6152"
    }
  }'

Responses

Successful creation of the scheme token

Bodyapplication/json
schemeTokenIdstring, (uuid)

The unique scheme token ID generated by PXP. It is used as a reference to extract the schemeTokenNumber.

fundingSourcestring or null

The funding source type of the card.

Enum:"Credit""Debit""Prepaid"
Example:"Credit"
Response
{ "schemeTokenId": "7d87f401-6977-43a4-8e72-8ff457fc8633", "fundingSource": "Debit" }