Skip to content

Secure Payment Notification

Multiple payment notification methods

Apptus eSales RESTful API includes two different payment notification methods. The recommended notification method to use is Secure Payment Notification. Using this method also allows the cost of a product to be notified.

Server side operation only

Secure payment notifications can not be made as client side operations.

Authentication required

The HTTP header Api-Key must be present in the request.

The secure payment notification is to be sent when the visitor has placed an order of one or more products and completed payment.

Method

POST

URL format

/api/v2/notifications/payment?esales.market={market}&esales.customerKey={customerKey}&esales.sessionKey={sessionKey}

Parameters

Name Type Description Example
esales.sessionKey string A unique id. UUID / GUID 2F75A...EAFA6
esales.customerKey string Visitor id. UUID / GUID. 5G7HJ...R77T1
esales.market string Visitor Market Sweden
lines array[ ] Array with payment information. productKey: P1, quantity: 2, sellingPrice: 20.0, cost: 15.2
productKey string The unique key of the product. shirt_79709
variantKey string The unique key of the variant. shirt_red_7980
quantity int The quantity of the purchased product. 2
sellingPrice double The selling price of the purchased product. 20.0
cost double The cost of the purchased product. 15.2

Request body

{
    "lines": [
        {
            "productKey": "string",
            "variantKey": "string",
            "quantity": "int",
            "sellingPrice": "double",
            "cost": "double"
        } 
    ]
}

Request content-type

application/json

Response content-type

HTTP response code

Responses

Response Description
204 Notifications was received successfully.
400 There were no order lines in the payment notification. Missing or invalid required arguments.
403 A Api-Key was used, but it could not be validated.
5xx Server error such as cluster unavailable or busy. The response body may contain more information about the error.

Examples

Try out the API at the Apptus API Playground with your eSales Playground and API credentials.

Request

request-body.json

{
    "lines": [
        {
            "productKey":"P1",
            "quantity": 1,
            "sellingPrice": 10.35,
            "cost": 5.1,
            "variantKey": "V1"
        }
    ]
}

cURL

#!/bin/bash
curl -i \
-X POST \
-d @request-body.json \
-H "Content-Type: application/json" \
-H "Api-KEY: {PRIVATE-KEY}" \
"https://{CLUSTER-ID}.api.esales.apptus.cloud/api/v2/notifications/payment?esales.market=UK&esales.sessionKey=b106299c-eac0-4f6f-96d2-93e57c255784&esales.customerKey=d9528030-509c-4e0f-b585-7168f1e9feca"

Response

HTTP/1.1 204 No Content
×