Skip to main content

API: Request examples

Overview

This documentation provides an overview of the Orders API endpoints, including requests and responses for creating orders, retrieving payment methods, and checking payment statuses.

The examples use shop ID 115 and the test environment (stage).

Order request with required parameters only

Request

curl -L -X POST 'https://gateway.stage.vertexgateway.com/api/v1/order' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Api-Access-Token: 2d10f5be-e7fa-463e-b79e-6cb7cd226999' \
--data-raw '{
"shopId": 115,
"order": {
"orderNumber": "test01",
"cost": {
"amount": "56.00",
"currency": "CLP"
}
},
"paymentSettings": {
"instrumentType": "card",
"providerCode": "alps",
"acquirerCode": "lyra"
}
}'

Response

{
"data": {
"orderNumber": "test01",
"paymentLink": "https://payment-page.stage.vertexgateway.com/payment?session-id=1ef20f70-779b-657a-a3d3-3b4b627a1f5a&page-id=854"
}
}

Order request with all fields

Request

curl -L -X POST 'https://gateway.stage.vertexgateway.com/api/v1/order' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Api-Access-Token: 2d10f5be-e7fa-463e-b79e-6cb7cd226999' \
--data-raw '{
"shopId": 115,
"order": {
"orderNumber": "test04",
"cost": {
"amount": "56.99",
"currency": "PHP"
}
},
"customer": {
"customerId": "1",
"firstName": "John",
"lastName": "Doe",
"middleName": "James",
"phone": "79221110500",
"email": "john.doe@mymail.com"
},
"paymentSettings": {
"instrumentType": "card",
"providerCode": "alps",
"acquirerCode": "lyra",
"entryMode": "cnp",
"dataEntryMode": "redirect",
"autoCapture": true,
"timeLimit": "2024-06-15T10:51:49.086Z",
"redirectUrls": {
"success": "https://example.com/success",
"failure": "https://example.com/failure"
},
"webhookUrl": "https://example.com/webhook"
},
"paymentPageDesign": {
"alias": "default",
"format": "redirect"
}
}'

Response

{
"data": {
"orderNumber": "test04",
"paymentLink": "https://payment-page.stage.vertexgateway.com/payment?session-id=i2g40f50-234b-567a-l4c5-1d6c4d527a5i&page-id=109"
}
}

Creating an order with customer information / Updating existing customer information

If you need to update the customer information with the corresponding customerId, simply pass the same customerId, specify the required fields for customer object (First Name, Last Name), and provide the updated customer information.

Request

curl -L -X POST 'https://gateway.stage.vertexgateway.com/api/v1/order' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Api-Access-Token: 2d10f5be-e7fa-463e-b79e-6cb7cd226999' \
--data-raw '{
"shopId": 115,
"order": {
"orderNumber": "test20",
"cost": {
"amount": "56.99",
"currency": "PHP"
}
},
"customer": {
"customerId": "1",
"firstName": "John",
"lastName": "Doe",
"middleName": "James",
"phone": "79221110500",
"email": "john.doe@mymail.com"
},
"paymentSettings": {
"instrumentType": "card",
"providerCode": "alps",
"acquirerCode": "lyra",
"entryMode": "cnp",
"dataEntryMode": "redirect",
"autoCapture": true,
"timeLimit": "2024-06-15T10:51:49.086Z",
"redirectUrls": {
"success": "https://example.com/success",
"failure": "https://example.com/failure"
},
"webhookUrl": "https://example.com/webhook"
}
}'

Retrieve available payment methods for a shop

Request

curl -L -X GET 'https://gateway.stage.vertexgateway.com/api/v1/shops/115/payment-methods' \
-H 'Accept: application/json' \
-H 'Api-Access-Token: 2d10f5be-e7fa-463e-b79e-6cb7cd226999'

Response

{
"data": [
{
"providerCode": "cleo",
"acquirerCode": "cleo",
"instrumentType": "bank_transfer",
"entryMode": null,
"allowedCards": [],
"transferType": "bank_wire",
"dataEntryModes": [
"redirect"
],
"currencies": [
"CLP"
],
"regions": [
"CL"
],
"isDefault": false
},
{
"providerCode": "alps",
"acquirerCode": "lyra",
"instrumentType": "card",
"entryMode": "cnp",
"dataEntryModes": [
"redirect"
],
"allowedCards": [
"visa"
],
"transferType": null,
"currencies": [
"CLP"
],
"regions": [
"CL"
],
"isDefault": false
},
{
"providerCode": "connectpay",
"acquirerCode": "gcash",
"instrumentType": "wallet",
"entryMode": null,
"dataEntryModes": [
"h2h"
],
"allowedCards": [],
"transferType": null,
"currencies": [
"CLP"
],
"regions": [
"CL"
],
"isDefault": false
}
]
}

Check order status

Request

curl -L -X GET 'https://gateway.stage.vertexgateway.com/api/v1/order/115/test07' \
-H 'Accept: application/json' \
-H 'Api-Access-Token: 2d10f5be-e7fa-463e-b79e-6cb7cd226999'

Response

{
"data": {
"shopId": 115,
"orderNumber": "test07",
"orderStatus": "cancelled",
"cost": {
"amount": "56",
"currency": "CLP"
},
"timeLimit": "2024-06-02T15:45:46+00:00",
"orderCreatedAt": "2024-06-02T15:30:46+00:00",
"orderPaidAt": null,
"autoCapture": true,
"payments": [],
"customer": null
}
}

Complete Flow: Retrieve Methods, Create Order, Check Status

For card payments

Step 1: Retrieve payment methods

Request

curl -L -X GET 'https://gateway.stage.vertexgateway.com/api/v1/shops/115/payment-methods' \
-H 'Accept: application/json' \
-H 'Api-Access-Token: 2d10f5be-e7fa-463e-b79e-6cb7cd226999'

Response

{
"data": [
{
"providerCode": "paysage",
"acquirerCode": "paysage",
"instrumentType": "card",
"entryMode": "cnp",
"dataEntryModes": [
"h2h"
],
"allowedCards": [
"visa",
"mastercard"
],
"transferType": null,
"currencies": [
"EUR"
],
"regions": [
"GB"
],
"isDefault": true
},
{
"providerCode": "alps",
"acquirerCode": "lyra",
"instrumentType": "card",
"entryMode": "cnp",
"dataEntryModes": [
"redirect"
],
"allowedCards": [
"visa"
],
"transferType": null,
"currencies": [
"CLP"
],
"regions": [
"CL"
],
"isDefault": false
},
{
"providerCode": "cleanpay",
"acquirerCode": "cleanpay",
"instrumentType": "card",
"entryMode": "cnp",
"dataEntryModes": [
"redirect"
],
"allowedCards": [
"visa",
"mastercard"
],
"transferType": null,
"currencies": [
"EUR",
"USD"
],
"regions": [
"AM"
],
"isDefault": false
}
]
}

Step 2: Create order

Request

curl -L -X POST 'https://gateway.stage.vertexgateway.com/api/v1/order' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Api-Access-Token: 2d10f5be-e7fa-463e-b79e-6cb7cd226999' \
--data-raw '{
"shopId": 115,
"order": {
"orderNumber": "test08",
"cost": {
"amount": "56.00",
"currency": "EUR"
}
},
"paymentSettings": {
"instrumentType": "card",
"providerCode": "paysage",
"acquirerCode": "paysage",
"entryMode": "cnp",
"dataEntryMode": "h2h"
}
}'

Response

{
"data": {
"orderNumber": "test08",
"paymentLink": "https://payment-page.stage.vertexgateway.com/payment?session-id=a7d20f70-891b-123a-b4c3-9d3c4b627a1a&page-id=108"
}
}

Step 3: Check order status

Request

curl -L -X GET 'https://gateway.stage.vertexgateway.com/api/v1/order/115/test08' \
-H 'Accept: application/json' \
-H 'Api-Access-Token: 2d10f5be-e7fa-463e-b79e-6cb7cd226999'

Response

{
"data": {
"shopId": 115,
"orderNumber": "test08",
"orderStatus": "cancelled",
"cost": {
"amount": "56",
"currency": "EUR"
},
"timeLimit": "2024-06-02T15:45:46+00:00",
"orderCreatedAt": "2024-06-02T15:30:46+00:00",
"orderPaidAt": null,
"autoCapture": true,
"payments": [],
"customer": null
}
}

For wallet payments

Step 1: Retrieve payment methods

Request

curl -L -X GET 'https://gateway.stage.vertexgateway.com/api/v1/shops/115/payment-methods' \
-H 'Accept: application/json' \
-H 'Api-Access-Token: 2d10f5be-e7fa-463e-b79e-6cb7cd226999'

Response

{
"data": [
{
"providerCode": "connectpay",
"acquirerCode": "gcash",
"instrumentType": "wallet",
"entryMode": null,
"dataEntryModes": [
"h2h"
],
"allowedCards": [],
"transferType": null,
"currencies": [
"PHP"
],
"regions": [
"PH"
],
"isDefault": false
},
{
"providerCode": "dukpay",
"acquirerCode": "grabpay",
"instrumentType": "wallet",
"entryMode": null,
"dataEntryModes": [
"redirect"
],
"allowedCards": [],
"transferType": null,
"currencies": [
"PHP"
],
"regions": [
"PH"
],
"isDefault": false
}
]
}

Step 2: Create order

Request

curl -L -X POST 'https://gateway.stage.vertexgateway.com/api/v1/order' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Api-Access-Token: 2d10f5be-e7fa-463e-b79e-6cb7cd226999' \
--data-raw '{
"shopId": 115,
"order": {
"orderNumber": "test11",
"cost": {
"amount": "56.00",
"currency": "PHP"
}
},
"paymentSettings": {
"instrumentType": "wallet",
"providerCode": "connectpay",
"acquirerCode": "gcash",
"dataEntryMode": "h2h"
}
}'

Response

{
"data": {
"orderNumber": "test11",
"paymentLink": "https://payment-page.stage.vertexgateway.com/payment?session-id=d7b20f80-456b-213a-g1c9-7d5c4b327a5d&page-id=111"
}
}

Step 3: Check payment status

Request

curl -L -X GET 'https://gateway.stage.vertexgateway.com/api/v1/order/115/test11' \
-H 'Accept: application/json' \
-H 'Api-Access-Token: 2d10f5be-e7fa-463e-b79e-6cb7cd226999'

Response

{
"data": {
"shopId": 115,
"orderNumber": "test11",
"orderStatus": "in_progress",
"cost": {
"amount": "56.00",
"currency": "PHP"
},
"timeLimit": "2024-06-02T16:43:51+00:00",
"orderCreatedAt": "2024-06-02T16:28:51+00:00",
"orderPaidAt": null,
"autoCapture": true,
"payments": [],
"customer": null
}
}

For bank transfer payments

Step 1: Retrieve payment methods

Request

curl -L -X GET 'https://gateway.stage.vertexgateway.com/api/v1/shops/115/payment-methods' \
-H 'Accept: application/json' \
-H 'Api-Access-Token: 2d10f5be-e7fa-463e-b79e-6cb7cd226999'

Response

{
"data": [
{
"providerCode": "zippy",
"acquirerCode": "zippy",
"instrumentType": "bank_transfer",
"entryMode": null,
"dataEntryModes": [
"redirect"
],
"allowedCards": [],
"transferType": "bank_wire",
"currencies": [
"CLP"
],
"regions": [
"CL"
],
"isDefault": false
},
{
"providerCode": "platcore",
"acquirerCode": "platcore",
"instrumentType": "bank_transfer",
"entryMode": null,
"dataEntryModes": [
"redirect"
],
"allowedCards": [],
"transferType": "sbp",
"currencies": [
"RUB"
],
"regions": [
"RU"
],
"isDefault": false
}
]
}

Step 2: Create order

Request

curl -L -X POST 'https://gateway.stage.vertexgateway.com/api/v1/order' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Api-Access-Token: 2d10f5be-e7fa-463e-b79e-6cb7cd226999' \
--data-raw '{
"shopId": 115,
"order": {
"orderNumber": "test13",
"cost": {
"amount": "56.00",
"currency": "CLP"
}
},
"paymentSettings": {
"instrumentType": "bank_transfer",
"providerCode": "zippy",
"acquirerCode": "zippy",
"dataEntryMode": "redirect"
}
}'

Response

{
"data": {
"orderNumber": "test13",
"paymentLink": "https://payment-page.stage.vertexgateway.com/payment?session-id=f5d30f10-789b-657a-i3d7-4d3e4c827a8f&page-id=113"
}
}

Step 3: Check payment status

Request

curl -L -X GET 'https://gateway.stage.vertexgateway.com/api/v1/order/115/test13' \
-H 'Accept: application/json' \
-H 'Api-Access-Token: 2d10f5be-e7fa-463e-b79e-6cb7cd226999'

Response

{
"data": {
"shopId": 115,
"orderNumber": "test13",
"orderStatus": "in_progress",
"cost": {
"amount": "56",
"currency": "CLP"
},
"timeLimit": "2024-06-02T16:50:50+00:00",
"orderCreatedAt": "2024-06-02T16:35:50+00:00",
"orderPaidAt": null,
"autoCapture": true,
"payments": [],
"customer": null
}
}