Skip to content

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.

Server side operation recommended

The payment notification is recommended to be made as a server side operation and not as a client side operation with the JavaScript library.

The 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/v1/notifications/payment

Parameters

Name Type Description Example
sessionKey string A unique id. UUID / GUID 2F75A...EAFA6
customerKey string Visitor id. SHA256 hash if the visitor is signed in, otherwise a UUID / GUID. 5G7HJ...R77T1
market string Visitor Market Sweden
token string Unique token generated by the CustomerKeyAuthentication class. Should only be set for signed in visitors. EAFA6...2F75A
lines array[ ] Array with payment information. productKey: P1, quantity: 2, sellingPrice: 20.0
productKey string The unique key of the product. Not mandatory when variantKey is set. shirt_79709
variantKey string The unique key of the variant. Not mandatory when productKey is set. shirt_blue_79709
quantity int The quantity of the purchased product. 2
sellingPrice double The selling price of the purchased product. 20

Request body

{
    "sessionKey": "string",
    "customerKey": "string",
    "market": "string",
    "token": "string",
    "lines": [
        {
            "productKey": "string",
            "variantKey": "string",
            "quantity": "int",
            "sellingPrice": "double"
        } 
    ]
}

Request content-type

application/json

Response content-type

HTTP response code

Responses

Response Description
204 Notifications was received successfully.
400 The payment was invalid (e.g. no order lines or both productKey and variantKey were null or empty).
403 A personal customer key was used, but it could not be validated, or 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.

Examples

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

Request

request-body.json

{
    "sessionKey": "b106299c-eac0-4f6f-96d2-93e57c255784",
    "customerKey": "d9528030-509c-4e0f-b585-7168f1e9feca",
    "market": "UK",
    "lines": [
        {
            "productKey":"P_555452-0446_UK",
            "quantity": 1,
            "sellingPrice": 10.35,
            "variantKey": null
        }
    ]
}

cURL

#!/bin/bash
curl -i \
-X POST \
-d @request-body.json \
-H "Content-Type: application/json" \
"https://{cluster-id}.api.esales.apptus.cloud/api/v1/notifications/payment"

Response

HTTP/1.1 204 No Content
×