GatewayPay Documentation
  1. H2H flow
GatewayPay Documentation
  • GatewayPay API Documentation
  • Authentication
  • Callbacks
  • Testing
  • Domains and IP Addresses
  • Account
    • Get Account profile details
      GET
    • Get Account balances
      GET
    • Get Account payment options
      GET
  • H2H flow
    • Status List
    • Create Payment Invoice
      POST
    • Send Card Data to the Gateway
      POST
    • Full List of Payment Services
      GET
    • Get Service Data by ID
      GET
    • Check Status of Payment Invoice by ID
      GET
    • Get list of Payment Invoices
      GET
  • Refunds
    • Refund
      POST
  • Cards Whitelist API
    • JSON
      POST
    • CSV
      POST
  • APM - Deposits
    • Bank Transfers - Turkey
      POST
  • APM - Payouts
    • Bank Transfers - Turkey (Invoice Initiation)
      POST
    • Bank Transfers - Turkey (Invoice processing)
      POST
  1. H2H flow

Create Payment Invoice

POST
/payment-invoices

Request

Authorization
Send your HTTP requests with an
Authorization
header that contains the word Basic followed by a space and a base64-encoded string username:password
Example:
Authorization: Basic *****************
Header Params
Host
string 
optional
Example:
{{BASE_API_URL}}
Body Params application/json
data
object 
required
type
string 
required
attributes
object 
required
Example
{
      "data":{
          "type":"payment-invoices",
          "attributes":{
            "reference_id":"{{$guid}}",
            "amount":100,
            "currency":"EUR",
            "service":"payment_card_eur_hpp",
            "flow":"charge",
            "test_mode":true,
            "description":"Invoice Example",
            "gateway_options":{
                "cardgate":{
                  "tokenize":false
                }
            },
            "customer":{
                "reference_id":"1203515",
                "email":"somename@domain.com",
                "name":"John Wick",
                "phone":"+380987654321",
                "address": {
                  "country": "GB",
                  "region": "Test region",
                  "city": "Test city",
                  "street": "Test street",
                  "full_address": "Test address",
                  "post_code": "12345"
                },
                "metadata":{
                  "key1":"value1",
                  "key2":"value2"
                }
            },
            "metadata":{
                "key":"value"
            },
            "return_url":"https://example.com",
            "return_urls": {
                "success":"https://example.com/1",
                "pending":"https://example.com/2",
                "fail":"https://example.com/3"
            },
            "callback_url":"https://example.com"
          }
      }
    }

Responses

🟢201Created
application/json
Body
data
object 
required
type
string 
required
id
string 
required
attributes
object 
required
relationships
object 
required
links
object 
required
Example
{
    "data": {
        "type": "payment-invoices",
        "id": "cpi_HGRJtCC3f9gteGIq",
        "attributes": {
            "status": "process_pending",
            "resolution": "ok",
            "moderation_required": false,
            "amount": 100,
            "payment_amount": 100,
            "currency": "EUR",
            "service_amount": null,
            "payment_service_amount": null,
            "exchange_rate": null,
            "service_currency": "EUR",
            "reference_id": "10d8cda0-f10a-4922-b2ec-ab0922ee4d6b",
            "test_mode": true,
            "fee": 0,
            "deposit": 100,
            "processed": null,
            "processed_amount": null,
            "refunded_amount": null,
            "refunded_fee": null,
            "refunded": null,
            "processed_fee": null,
            "processed_deposit": null,
            "failed": null,
            "metadata": {
                "key": "value"
            },
            "flow_data": {
                "action": "https://checkout.example.com/hpp/cgi_Roz11rrJJIXIF5D8",
                "method": "GET",
                "params": [],
                "metadata": {
                    "sid": "cgi_Roz11rrJJIXIF5D8",
                    "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzaWQiOiJjZ2lfUm96MTFyckpKSVhJRjVEOCIsImV4cGlyZXMiOm51bGwsImV4cCI6MTcyODQ3NDgyOX0.RIJBwePA_v45MxI5fdh8LOGx3OjvMJw8ieCLd_HgjAE"
                }
            },
            "flow": "hpp",
            "payment_flow": "charge",
            "created": 1728471229,
            "updated": 1728471229,
            "payload": null,
            "description": "Invoice Example",
            "descriptor": null,
            "callback_url": "https://example.com",
            "return_url": "https://example.com",
            "return_urls": {
                "fail": "https://example.com/3",
                "pending": "https://example.com/2",
                "success": "https://example.com/1"
            },
            "original_data": [],
            "rrn": null,
            "arn": null,
            "approval_code": null,
            "reserved_amount": null,
            "reserve_expires": null,
            "unreserved": null,
            "source": "merchant_api",
            "callback_logs": [],
            "charged_back_amount": null,
            "charged_back": null,
            "resolution_message": null,
            "hpp_url": "https://api.example.com/redirect/hpp/?cpi=cpi_HGRJtCC3f9gteGIq",
            "refunds": [],
            "reserves": [],
            "reserve_options": null,
            "processed_unreserve": null,
            "processed_reserve_cancel": null,
            "reserve_cancelled": null
        },
        "relationships": {
            "payment-service": {
                "data": {
                    "type": "payment-services",
                    "id": "payment_card_eur_hpp"
                }
            },
            "payment-method": {
                "data": {
                    "type": "payment-methods",
                    "id": "payment_card"
                }
            },
            "customer": {
                "data": {
                    "type": "customers",
                    "id": "cus_UmjAaFyifjsKNHpY"
                }
            },
            "active-payment": {
                "data": {
                    "type": "payments",
                    "id": "pay_aRex7FdEWr5lfH1Tr0HhJsL6"
                }
            }
        },
        "links": {
            "self": "/api/payment-invoices/cpi_HGRJtCC3f9gteGIq"
        }
    }
}
Modified at 2024-10-09 12:23:29
Previous
Status List
Next
Send Card Data to the Gateway
Built with