On This Page

{#jumplink-list}  
[Markdown](/docs/cybs/en-us/payments/developer/barclays/rest/payments/payment-tms-process-intro/tms-cust-tkn-pay-intro.md)  
Filter  
FILTER BY TAG

Authorizing a Payment with a Customer Token {#tms-cust-tkn-pay-intro}
=====================================================================

This section provides the information you need to authorize a payment with a customer token.

Endpoint
--------

**Production:** `POST ``https://api.cybersource.com``/pts/v2/payments `  
**Test:** `POST ``https://apitest.cybersource.com``/pts/v2/payments `{#tms-cust-tkn-pay-intro_restcust-test}  
**Production in India:** `POST ``https://api.in.cybersource.com``/pts/v2/payments`{#tms-cust-tkn-pay-intro_restcust-prod-india}

Required Fields for Authorizing a Payment with a Customer Token {#tms-cust-tkn-pay-reqfields}
=============================================================================================

[clientReferenceInformation.code](https://developer.cybersource.com/docs/cybs/en-us/api-fields/reference/all/rest/api-fields/client-ref-info-aa/client-ref-info-code.md "")
:

[orderInformation.amountDetails.currency](https://developer.cybersource.com/docs/cybs/en-us/api-fields/reference/all/rest/api-fields/order-info-aa/order-info-amount-details-currency.md "")

[orderInformation.amountDetails.totalAmount](https://developer.cybersource.com/docs/cybs/en-us/api-fields/reference/all/rest/api-fields/order-info-aa/order-info-amount-details-total-amount.md "")
:

paymentInformation.customer.id
:
Set to the ID of the customer token you want to use.
{#tms-cust-tkn-pay-reqfields_dl_u12_vqy_dwb}

Related Information {#tms-cust-tkn-pay-reqfields_section_jpc_xzz_sxb}
---------------------------------------------------------------------

* [API field reference guide for the REST API](https://developer.cybersource.com/docs/cybs/en-us/api-fields/reference/all/rest/api-fields/api-fields-about-guide.md "")
  {#tms-cust-tkn-pay-reqfields_ul_kpc_xzz_sxb}

REST Example: Authorizing a Payment with a Customer Token {#tms-cust-tkn-pay-ex-rest}
=====================================================================================

Request

```
{
  "clientReferenceInformation": {
    "code": "12345678"
  },
    "paymentInformation": {
        "customer": {
            "id": "F45FB3E443AC3C57E053A2598D0A9CFF"
        }
        
    },
    "orderInformation": {
        "amountDetails": {
            "currency": "USD",
            "totalAmount": "10.00"
        }
    }
}
```

{#tms-cust-tkn-pay-ex-rest_codeblock_ndp_y3n_lwb}  
Response to a Successful Request  
The request response returns the payment instrument and shipping address IDs that are used as the customer's defaults.

```
{
  "_links": {
    "authReversal": {
      "method": "POST",
      "href": "/pts/v2/payments/7055928871556818104953/reversals"
    },
    "self": {
      "method": "GET",
      "href": "/pts/v2/payments/7055928871556818104953"
    },
    "capture": {
      "method": "POST",
      "href": "/pts/v2/payments/7055928871556818104953/captures"
    }
  },
  "clientReferenceInformation": {
    "code": "12345678"
  },
  "id": "7055928871556818104953",
  "orderInformation": {
    "amountDetails": {
      "authorizedAmount": "10.00",
      "currency": "USD"
    }
  },
  "paymentAccountInformation": {
    "card": {
      "type": "001"
    }
  },
  "paymentInformation": {
    "tokenizedCard": {
      "type": "001"
    },
    "instrumentIdentifier": {
      "id": "7010000000016241111",
      "state": "ACTIVE"
    },
    "shippingAddress": {
      "id": "0F35F0D99AD088B5E063A2598D0AE066"
    },
    "paymentInstrument": {
      "id": "0F35E9CFEA463E34E063A2598D0A3FC2"
    },
    "card": {
      "type": "001"
    },
    "customer": {
      "id": "B21E6717A6F03479E05341588E0A303F"
    }
  },
  "pointOfSaleInformation": {
    "terminalId": "111111"
  },
  "processorInformation": {
    "approvalCode": "888888",
    "networkTransactionId": "123456789619999",
    "transactionId": "123456789619999",
    "responseCode": "100",
    "avs": {
      "code": "X",
      "codeRaw": "I1"
    }
  },
  "reconciliationId": "67467352CRIISD1G",
  "status": "AUTHORIZED",
  "submitTimeUtc": "2024-01-18T15:48:07Z"
}
```

{#tms-cust-tkn-pay-ex-rest_codeblock_pdp_y3n_lwb}

REST Example: Authorizing a Payment Using a Customer Token Linked to a Network Token {#tms-cust-tkn-pay-nt-ex-rest}
===================================================================================================================

Request

```
{
  "clientReferenceInformation": {
    "code": "12345678"
  },
  "paymentInformation": {
    "customer": {
      "id": "F60328413BAB09A4E053AF598E0A33DB"
    }
  },
  "orderInformation": {
    "amountDetails": {
      "totalAmount": "102.21",
      "currency": "USD"
    }
  }
}
```

{#tms-cust-tkn-pay-nt-ex-rest_codeblock_ndp_y3n_lwb}  
Response to a Successful Request  
The request response returns the payment instrument and shipping address IDs that are used as the customer's defaults.

```
{
  "_links": {
    "authReversal": {
      "method": "POST",
      "href": "/pts/v2/payments/6778647071126384904953/reversals"
    },
    "self": {
      "method": "GET",
      "href": "/pts/v2/payments/6778647071126384904953"
    },
    "capture": {
      "method": "POST",
      "href": "/pts/v2/payments/6778647071126384904953/captures"
    }
  },
  "clientReferenceInformation": {
    "code": "TC50171_3"
  },
  "id": "6778647071126384904953",
  "issuerInformation": {
    "responseRaw": "0110322000000E100002000....."
  },
  "orderInformation": {
    "amountDetails": {
      "authorizedAmount": "102.21",
      "currency": "USD"
    }
  },
  "paymentAccountInformation": {
    "card": {
      "type": "002"
    }
  },
  "paymentInformation": {
    "tokenizedCard": {
      "type": "002"
    },
    "instrumentIdentifier": {
      "id": "7020000000010603216",
      "state": "ACTIVE"
    },
    "shippingAddress": {
      "id": "F60328413BAE09A4E053AF598E0A33DB"
    },
    "paymentInstrument": {
      "id": "F6032841BE33098EE053AF598E0AB0A5"
    },
    "card": {
      "type": "002"
    },
    "customer": {
      "id": "F60328413BAB09A4E053AF598E0A33DB"
    }
  },
  "pointOfSaleInformation": {
    "terminalId": "08244117"
  },  "processingInformation": {    "paymentSolution": "014"  },
  "processorInformation": {
    "paymentAccountReferenceNumber": "50015OU4U5UYXLV127XTONYN49CL1",
    "merchantNumber": "000844028303882",
    "approvalCode": "831000",
    "networkTransactionId": "0602MCC603474",
    "transactionId": "0602MCC603474",
    "responseCode": "00",
    "avs": {
      "code": "Y",
      "codeRaw": "Y"
    }
  },
  "reconciliationId": "EUHW1EMHIZ3O",
  "status": "AUTHORIZED",
  "submitTimeUtc": "2023-03-03T17:31:48Z"
}
```

{#tms-cust-tkn-pay-nt-ex-rest_codeblock_pdp_y3n_lwb}  
RELATED TO THIS PAGE

