The Rest API works by sending http calls to specific resources identified by url's. The http verb (e.g. GET or POST) defines the action on the resource.

Resource Description
Orders Create, list and query order details.
Captures Create and update captures.

Type Formats

Type Example Description
Date "2017-02-24" A date formatted according ISO 8601.
DateTime "2017-02-24T17:08:43Z" A date and time in seconds formatted according ISO 8601 with timezone in UTC.
Currency "EUR" A currency as ISO 4217 Alpha 3, i.e. three uppercase letters.
Language "nl" A language as ISO 639-1 Alpha 2, i.e. two lowercase letters.
Country "NL" A country as ISO 3166-1 Alpha 2, i.e. two uppercase letters.

Field Requirements

For each field in the request and response the requirements are specified in the column M:

Mandatory (M) The field must be included in the request, or will be present in the response.
Optional (O) The field may be included in the request, or may be present in the response.
Conditional (C) The field must be included in the request, or will be present in the response, depending on other conditions.

Error Responses

Errors are indicated by the http status 4xx. The JSON response contain the details of the error.


Field Type M Description
messages String[] M One or more messages giving details about the error.

HTTP Status

Status Meaning
400 (Bad Request) The parameters or request are not valid.
401 (Unauthorized) Authorization header missing or invalid.
403 (Forbidden) The merchant key is not allowed. or the request is not (yet) allowed.
404 (Not Found) The reference was not found.
405 (Conflict) The new reference was not unique.
500 (Internal Server Error) Something went wrong.

Error response example

> curl \
    -X POST \
    --header 'Content-Type: application/json' \
    --header 'Authorization: Basic RG9jZGF0YVBGOkJXazJhZkpV' \
    https://testsecure.docdatapayments.com/ps/api/public/v1/merchants/4ef08825-993a-424d-a769-3ee97116a1b6/orders \
    -d '{
        "reference"     : "vk20170224p",
        "description"   : "Order 12345",
        "amount"        : 3330,
        "currency"      : "EUR",
        "country"       : "NLD"

< Http 400 - Bad Request
<    '{
        "messages": [
            "Property 'country' must match \"[A-Z]{2}\"",
            "Property 'email' may not be null"