# Create scheme token

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

Endpoint: POST /token-vault/{ownerType}/{ownerId}/vaults/scheme-tokens
Version: 1.0.0

## Path parameters:

  - `ownerId` (string, required)
    The unique identifier of the entity owning the token (e.g., Referrer, Merchant Group, Merchant, Site).
    Example: "MERCHANT-GROUP-1"

  - `ownerType` (string, required)
    The type of entity owning the token (e.g., Referrer, MerchantGroup, Merchant or Site).
    Enum: "Referrer", "MerchantGroup", "Merchant", "Site"

## Request fields (application/json):

  - `card` (object, required)
    Details about the card for tokenisation.

  - `card.primaryAccountNumber` (string, required)
    The unique number assigned to a payment card, such as a credit or debit card. This number typically contains 16 digits, structured in a specific format to indicate the card network, issuing bank, and account number.
    Example: "4111111111111111"

  - `card.expiryMonth` (string, required)
    The expiry month of the card, as a number from 1 to 12. Typically zero-padded to two digits (for example, 03).
    Example: "03"

  - `card.expiryYear` (string, required)
    The expiry year of the card (YYYY).
    Example: "2025"

  - `card.holderName` (string, required)
    The full name of the individual who owns the payment card. This name is printed on the physical card and is used for verifying the cardholder's identity during transactions. The cardholder name is a vital component for transaction processing, especially in cases of card-not-present transactions like online purchases. It should be treated with confidentiality to safeguard the cardholder's privacy and prevent potential misuse.
    Example: "Mr John Doe"

  - `card.cardVerificationCode` (string,null)
    The Card Verification Code (CVC) associated with the payment card, a security feature for transactions where the card is not physically present. The security code is typically a 3 or 4 digit number found on the card, used to verify that the cardholder is in possession of the card during non-face-to-face transactions.
    Example: "123"

  - `customerConsent` (object)
    Details about customer consent for token storage.

  - `customerConsent.hasCustomerConsent` (boolean,null)
    Whether the customer has provided consent for storing their payment card details.

  - `customerConsent.merchantShopperId` (string,null)
    A unique identifier for the shopper.
    Example: "shopper-123"

## Response 200 fields (application/json):

  - `schemeTokenId` (string)
    The unique scheme token ID generated by PXP. It is used as a reference to extract the schemeTokenNumber.

  - `fundingSource` (string,null)
    The funding source type of the card.
    Enum: "Credit", "Debit", "Prepaid"

## Response 400 fields (application/json):

  - `correlationId` (string)
    The unique identifier for this error response. Include it when contacting PXP support.
    Example: "81f32b80-2ba0-4430-8ecd-0b559274ba9c"

  - `details` (array)
    Additional details about the error.

  - `errorCode` (string)
    The error code returned for the operation.
    Example: "INVALID_REQUEST"

  - `errorReason` (string)
    The error reason returned for the operation.
    Example: "The request parameters are invalid."


