Payment¶
The payment notification is to be sent when the visitor has placed an order of one or more products and completed payment.
Request¶
Request method¶
POST
Request URL¶
https://{cluster-id}.api.esales.apptus.cloud/api/v2/notifications/payment?market={market}&customerKey={customerKey}&sessionKey={sessionKey}
Request parameters¶
Name | Type | Description | Example |
---|---|---|---|
market | string | The visitor market. Must match the corresponding market identifier in the data feed. Required | UK |
customerKey | string | A key that uniquely identifies the current visitor. Using UUIDs as keys are recommended. Required | 0b05119e-eeb8-418a-bbfb-defa0dde417e |
sessionKey | string | A unique key, identifying the session. Using UUIDs as keys are recommended. Required | 0b05119e-eeb8-418a-bbfb-defa0dde417e |
lines | array[ ] | Array with payment information. Required | variantKey: V1, quantity: 2, sellingPrice: 20.0 |
variantKey | string | The unique key of the variant. Required | shirt_red_xs |
quantity | int | The quantity of the purchased product. Required | 2 |
sellingPrice | double | The selling price of the purchased product. Required | 20.0 |
cost | double | The cost of the purchased product. It is strongly recommended to provide cost , either included in a payment notification or as an attribute in the data feed. For more information about cost, see Best Practices. Recommended | 15.2 |
Request headers¶
Api-Key
- The unique apiKey
provided by Apptus.
Request content-type¶
application/json
Request body¶
{
"lines": [
{
"variantKey": "string",
"quantity": "int",
"sellingPrice": "double",
"cost": "double"
}
]
}
Request example¶
A payment notification example is demonstrated using cURL below.
request-body.json¶
{
"lines": [
{
"quantity": 1,
"sellingPrice": 10.35,
"variantKey": "shirt_red_xs",
"cost": "7.75"
}
]
}
cURL¶
#!/bin/bash
curl -i \
-X POST \
-T request-body.json \
-H "Content-Type: application/json" \
-H "Api-Key: pkA123456789AB1BDA3E968F69A97B5508BF5B123456778912FFC99" \
"https://{cluster-id}.api.esales.apptus.cloud/api/v2/notifications/payment?market=UK&customerKey=d9528030-509c-4e0f-b585-7168f1e9feca&sessionKey=b106299c-eac0-4f6f-96d2-93e57c255784"
Response¶
Response headers¶
N/A
Response content-type¶
HTTP response code
Response codes¶
Response | Description |
---|---|
204 | Notifications was received successfully. |
400 | There were no order lines in the payment notification, missing or invalid required arguments |
403 | Client side payment notifications has been disabled for this cluster. |
5xx | Server error such as cluster unavailable or busy. The response body may contain more information about the error. |
Response objects¶
Response example
HTTP/1.1 204 No Content