Processing Payment Requests

Process payment requests using the payment gateway endpoint.


If you support Apple Pay payment requests, you need to obtain the Apple Pay payment token from the customer's device. To receive this token, implement the payment gateway endpoint. Apple Pays calls this endpoint to send you the token and ask that you process the transaction. The URL to the endpoint must match the value in the paymentGatewayUrl field defined in the ApplePayEndpoints dictionary. For more information, see Sending an Apple Pay Payment Request.




The request body is a JSON dictionary with the following keys:


A dictionary containing payment information. For the list of payment dictionary keys, see Payment Dictionary.


An identifier for the request. Business Chat includes the identifier in its response to the CSP.


The version number of the message extension schema; the version should be 1.0.

Payment Dictionary

The payment dictionary keys are:


The customer's billing contact information. For more information, see billingContact.


The payment token. See Payment Token Format Reference for more information.


The customer's shipping address information. For more information, see shippingContact.

Sample Payment Gateway Request

content-type: application/json
    "requestIdentifier": "8EF748B5-3DC5-47AE-B185-65E91518D209",
    "version": "1.0",
    "payment": {
        "billingContact": {
            "phoneticFamilyName": "",
            "locality": "Cupertino",
            "postalCode": "95014",
            "subLocality": "",
            "administrativeArea": "CA",
            "country": "United States",
            "familyName": "Appleseed",
            "addressLines": ["1 Infinite Loop"],
            "givenName": "Johnny",
            "phoneticGivenName": "",
            "countryCode": "us"
        "shippingContact": {
            "phoneNumber": "55555555555",
            "emailAddress": "",
            "subLocality": "",
            "phoneticGivenName": "",
            "countryCode": "us",
            "phoneticFamilyName": "",
            "administrativeArea": "CA",
            "addressLines": ["1 Infinite Loop"],
            "givenName": "",
            "postalCode": "95014",
            "familyName": "",
            "locality": "Cupertino",
            "country": "United States"
        "shippingMethod": {
            "amount": "0",
            "label": "In-Store Pickup",
            "detail": "Available within an hour",
            "type": "Final",
            "identifier": "in_store_pickup"
        "paymentToken": {
            "transactionIdentifier": "5394..00",
            "paymentData": {
                "version": "EC_v1",
                "data": "kdHd..GQ==",
                "signature": "MIAGCSqGSIb3DQEH...AAA",
                "header": {
                    "applicationData": "94ee0..C2",
                    "transactionId": "d3b28af..f8",
                    "ephemeralPublicKey": "MFkwE..Q==",
                    "publicKeyHash": "dxCK..6o="


After processing the payment, send a response with the transaction results and errors, if any. The body of the response is a JSON dictionary with the following fields:


An array of ApplePayError types. This field is present only when the payment processing request detects errors.


Indicates the status of the transaction. For a list of status codes, see Apple Pay Status Codes.

Listing 2

Sample payment gateway response

    "status": "STATUS_SUCCESS"

See Also

Apple Pay Essentials

Accepting Apple Pay Payments

Accept payments from customers who use Apple Pay.

Sending an Apple Pay Payment Request

Request a payment from the customer by sending an Apple Pay payment request.