Payout

This section covers information about the processing payouts. General information, which is complementary to the section on payment models and statuses (Payout), is applicable to payments by payment cards and payments by using alternative instruments, while the detailed information is only applicable to payments by payment cards. For more information about payments by alternative instruments, see Payments by using alternative methods.

Overview

Payout is a payment type which uses one request to make a one-time transfer of funds from merchant to customer.

Basically, the payment platform performs payouts on demand (one-time payments) and P2P (person-to-person) payouts; though, you can implement bulk payouts by using Dashboard. In the latter case, you can have the required payouts generated automatically. For more information about bulk payouts, see Bulk payments.

Basically, payout initiation request contains payment instrument details. However, if you perform payout on a payment card you can perform payout by token that is associated with the payment card details. To enable this option, merchant must comply with the PCI DSS standard and you need to perform an initial payment (purchase) to create a token. For more information about using tokens, see Using tokens

The payout workflow

To perform a payout by using Gate the web service is required to do the following:

  1. Send the payout request to the following endpoint /v2/payment/{payment method}/payout[/token].
  2. If necessary, complete the additional procedure of payment information submission that is used when any payment stakeholder requires additional information. For more information, see Additional payment information submission.
  3. Receive the callback with payout results from the payment platform.

The following diagram provides the information about the basic payout processing case (without the completion of the additional procedure).



Figure: Payout processing by using Gate

  1. A customer initiates a payout.
  2. The web service sends the payout request by using Gate to the payment platform.
  3. The payment platform receives the payout request.
  4. The payment platform performs the initial request processing that includes validation of the required parameters and signature.
  5. The payment platform sends to the web service the response with request receipt confirmation and correctness check result.
  6. The payment platform performs the internal payment request processing and sends it to the payment environment. If you process the payout by using payment card, the payment environment is a bank service. If you process the payout by using alternative payment instrument, one is the payment system service.
  7. The payout is processed on the payment service side.
  8. The payment platform receives the payout result notification.
  9. The payment platform sends the callback to the web service.
  10. The customer receives the payment result from the web service.

The sections that follow discuss in more details the request format and the parameters to be used in requests for payouts to payment cards, as well as provide information about the format of callbacks which contain payout results.

Request format

There are several things you need to consider when using payout requests to payment cards:

  1. You perform payout by sending the request by using POST (HTTP) method to one of the following endpoints:
  2. The following objects and parameters must be specified in the request:
    • Object general—general request identification information:
      • project_id—the project ID obtained from ECommPay
      • payment_id—payment ID unique within the merchant project
      • signature—signature created after you specify all the required parameters. For more information about signature generation, see Signature generation and verification
    • Object customer—customer information:
      • id—the ID of the customer within the merchant project
      • first_name—customer first name
      • middle_name—customer middle name or patronymic
      • last_name—customer last name
      • ip_address—IP address
      Note: The first name, the middle name (or patronymic), and the last name of the customer must be specified for all cards with the exception of those issued in the Russian Federation. In case of CUP cards, this information must be provided in Chinese.
    • Object payment—payment information:
      • amount—payout amount in minor units
      • currency—payout currency in the ISO-4217 alpha-3 format
  3. The request must contain the following information about the payment card which will be used in the payout:
    • When payout by the card number—the card number in the pan parameter of the card object.

      In case of global payouts, together with the card number you may need to provide the expiration date and the name of the cardholder in the year, month, and card_holder parameters of the object card. To learn more about global payouts, contact your ECommPay account manager.

    • When payout by the token—token of the card received from ECommPay in the token parameter.
  4. In the case of a P2P payout it is recommended to specify the sender data:
    • first_name—first name
    • last_name—last name,
    • citizenship—citizenship
    • residence—country of residence
    • birthplace—place of birth
    • Object billing—sender billing address information
  5. If you pass the payment expiration parameter payment.best_before, you must also pass the card expiration parameters: card.month and card.year.
  6. If required, you can also add any other additional parameters and objects Gate supports.

Thus, to perform a payout on a payment card, the correct payout request must include project and payment IDs, signature, the ID and IP-address of the customer, amount and currency of the payout, as well as the number or token of the card (for crediting), as shown in the following example:

Figure: Example of a payout request

{
    general: {
        project_id: 874,
        payment_id: "1553840734526111",
        signature: "1wR1YgDoDlJppOdLzFOFKY4YonbWmspbFh7x1o1ut5PxxTIJfQ==",
    },
    // Card number when payout by the card number
    card: {
        pan: "5536913256780802"
    },
    customer: {
        id: "1",
        ip_address: "185.123.193.224"
    },
    payment: {
        amount: 15000,
        currency: "EUR"
    },
    // Card token when payout by the token
    token: "pkmawa3khb7wninntq8g8q3592fjjxwvzfebwbegqkl1c16akpgo6sgxac6wulz7"
}

Figure: Example of a P2P payout request

{
    "general": {
        "project_id": 100,
        "payment_id": "Payment 12",
        "signature": "2tlMuYxLW9Yu6RETr8pdCfmi0UPE8euD+2AbrQgJgu...=="
  },
    "card": {
        "pan": "4000135855554444",   
        "year": 2020,    
        "month": 11
    },
    "customer": {
        "ip_address": "127.0.0.1",
        "id": "New",
        "phone": "999123456",
        "first_name": "John",
        "middle_name": "Jr",
        "last_name": "Jonson",
        "datetime": "2017-10-04T19:06:31+05:00",
        "birthplace": "Manchester",
        "identify": {
            "doc_number": "4666 123456",
            "doc_type": "Passport",
            "doc_issue_date": "20.12.2012",
            "doc_issue_by": "12346"
        },
        "billing": {
            "country": "GB",
            "city": "London",
            "address": "Level st, 23",
            "postal": "112233"
        },
        "day_of_birth": "05-06-1981"
        },    
    "sender": {
        "phone": "39999999999",
        "first_name": "Jack",
        "middle_name": "Willy",
        "last_name": "Jackson",
        "datetime": "2018-12-05T19:06:31+05:00",
        "birthplace": "Manchester",
        "residence": "BL",
        "citizenship": "LV",
        "identify": {
            "doc_number": "1234 654321",
            "doc_type": "Passport",
            "doc_issue_date": "07-01-1995",
            "doc_issue_by": "23456"
        },
        "billing": {
            "country": "GB",
            "city": "London",
            "address": "Level st, 25",
            "postal": "406879"
        },
        "day_of_birth": "07-08-1993"
    },
    "payment": {
        "amount": 5000,
        "currency": "GBP"
    }
}

Callback format

The standard format for callbacks is used to deliver payout results. For more information, see Callbacks.

The following is the example of a callback with an information about successful 100.00 USD payout made to the card number 553691******0802 of the customer_10 customer in the 874 project.

Figure: Example of a successful payout callback

{
    {
        "project_id": 874,
        "payment": {
            "id": "3013",
            "type": "payout",
            "status": "success",
            "date": "2019-06-24T11:08:49+0000",
            "method": "card",
            "sum": {
                "amount": 10000,
                "currency": "USD"
            },
            "description": "sale"
        },
        "account": {
            "number": "553691******0802"
        },
        "customer": {
            "id": "customer_10"
        },
        "operation": {
            "id": 14,
            "type": "payout",
            "status": "success",
            "date": "2019-06-24T11:08:49+0000",
            "created_date": "2019-06-24T11:07:42+0000",
            "request_id": "71228f54d21e776a481",
            "sum_initial": {
                "amount": 10000,
                "currency": "USD"
            },
            "sum_converted": {
                "amount": 10000,
                "currency": "USD"
            },
            "provider": {
                "id": 1496,
                "payment_id": "60-1c6072de6000",
                "date": "2019-06-24T11:08:47+0000",
                "auth_code": ""
            },
            "code": "0",
            "message": "Success"
        },
        "signature": "+GTEzb3Xw4A9Ap8q/LE8TyyJM+MEXXja28RXtr8v2EITaK4UzSgifLxgB6c9TSeb/peLxw=="
    }
}

The following example of callback is for a payout rejected due to the maximum payout limit being exceeded.

Figure: Example of a declined payout callback

{
    {
        "project_id": 874,
        "payment": {
            "id": "3013",
            "type": "payout",
            "status": "decline",
            "date": "2019-06-24T11:08:49+0000",
            "method": "card",
            "sum": {
                "amount": 10000,
                "currency": "USD"
            },
            "description": "sale"
        },
        "account": {
            "number": "553691******0802"
        },
        "customer": {
            "id": "customer_10"
        },
        "operation": {
            "id": 14,
            "type": "payout",
            "status": "decline",
            "date": "2019-06-24T11:08:49+0000",
            "created_date": "2019-06-24T11:07:42+0000",
            "request_id": "71228f54d21e776a481",
            "sum_initial": {
                "amount": 10000,
                "currency": "USD"
            },
            "sum_converted": {
                "amount": 10000,
                "currency": "USD"
            },
            "provider": {
                "id": 1496,
                "payment_id": "60-1c6072de6000",
                "date": "2019-06-24T11:08:47+0000",
                "auth_code": ""
            },
             "code": "3104",
            "message": "Payment Constraint Invalid Payout Amount"
        },
        "signature": "+GTEzb3Xw4A9Ap8q/LE8TyyJM+MEXXja28RXtr8v2EITaK4UzSg...=="
    }
}