Add, obtain, and remove additional payment method specific data.

This additional data is only relevant for some payment methods and in specific use cases:

  • KLARNA: For more details see Klarna.

Add Additional Payment Method Data

Adds additional payment method specific data to an Order. Additional data cannot be added after a payment has been started.

POST /ps/api/public/v1/merchants/{merchant_key}/orders/{order_key}/additional_data

Identifiers

NameTypeDescription
merchant_keyMerchantKeyThe key of the merchant.
order_keyOrderKeyThe key of the order.

Parameters

Not applicable.

Request

FieldTypeMDescription
methodPaymentMethodMThe name of a payment method, e.g. KLARNA.
dataString(1, 4000)MThe additional data as a JSON-object as string with double quotes escaped.

An example of the encoded data is

"{ \"field_one\": \"value\", \"field_two\" : { \"sub_field\" : \"subValue\"}"

Supported payment methods

KLARNA

Response

Not response.

HTTP Status

StatusMeaning
201 (CreatedThe data is successfully added.
400 (Bad Request)The request was not valid. The JSON-data is incorrect, an invalid payment method given, order key not found or the payment was already done for the order.
401 (Unauthorized)Authorization header missing or invalid.
403 (Forbidden)The merchant account is not allowed to perform this operation.
404 (Not Found)The order was not found.

Add Additional Data example

Command line:

> 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/F1499C097FFA533D46FB05D52680AB9A/additional_data \
    -d '{
          "method": "KLARNA",
          "data": "{\"some_info\": \"Some text information\"}"
        }'
 
< Http 201 Created

Returns Additional Payment Method Data

Returns the additional payment method specific data associated with an Order. The result is an array of additional data per payment method for the given Order key.

GET /ps/api/public/v1/merchants/{merchant_key}/orders/{order_key}/additional_data

Identifiers

NameTypeDescription
merchant_keyMerchantKeyThe key of the merchant.
order_keyOrderKeyThe key of the order.

Parameters

Not applicable.

Request

Not applicable.

Response

Array of:

FieldTypeMDescription
methodPaymentMethodMThe name of a payment method, e.g. KLARNA.
dataString(1, 4000)MThe additional data as a JSON-object as string with double quotes escaped.

HTTP Status

StatusMeaning
200 (OK)Success.
400 (Bad Request)In valid request. If the order key not found.
401 (Unauthorized)Authorization header missing or invalid.
403 (Forbidden)The merchant account is not allowed to perform this operation.
404 (not found)The order was not found.

Get Additional Data example

Command line:

> curl \
    -X GET \
    --header 'Content-Type: application/json' \
    --header 'Authorization: Basic RG9jZGF0YVBGOkJXazJhZkpV' \
    https://testsecure.docdatapayments.com/ps/api/public/v1/merchants/4ef08825-993a-424d-a769-3ee97116a1b6/orders/F1499C097FFA533D46FB05D52680AB9A/additional_data
 
< Http 200 Ok
<   '[
        {
            "method": "KLARNA",
            "data": "{\"some_info\": \"Some text information\"}"
        }
    ]'

Deletes Additional Payment Method Data

Deletes the additional payment method specific data from an Order. The additional data cannot be deleted after payments are started.

The deletion can be done either by specifying payment method or not. If the payment method is not specified then the additional data for all payment methods is deleted from the Order.

DELETE /ps/api/public/v1/merchants/{merchant_key}/orders/{order_key}/additional_data
DELETE /ps/api/public/v1/merchants/{merchant_key}/orders/{order_key}/additional_data/{method}

Identifiers

NameTypeDescription
merchant_keyMerchantKeyThe key of the merchant.
order_keyOrderKeyThe key of the order.
methodPaymentMethodThe name of a payment method, e.g. KLARNA. (Optional)

Parameters

Not applicable.

Request

Not applicable.

Response

Not response.

HTTP Status

StatusMeaning
200 (OK)Success.
400 (Bad Request)In valid request, an invalid payment method given, order key not found or the payment was already done for the order.
401 (Unauthorized)Authorization header missing or invalid.
403 (Forbidden)The merchant account is not allowed to perform this operation.
404 (not found)The order was not found.

Delete Additional Data for payment method example

Command line:

> curl \
    -X DELETE \
    --header 'Content-Type: application/json' \
    --header 'Authorization: Basic RG9jZGF0YVBGOkJXazJhZkpV' \
    https://testsecure.docdatapayments.com/ps/api/public/v1/merchants/4ef08825-993a-424d-a769-3ee97116a1b6/orders/F1499C097FFA533D46FB05D52680AB9A/additional_data/KLARNA
 
< Http 200 Ok

Delete All Additional Data example

Command line:

> curl \
    -X DELETE \
    --header 'Content-Type: application/json' \
    --header 'Authorization: Basic RG9jZGF0YVBGOkJXazJhZkpV' \
    https://testsecure.docdatapayments.com/ps/api/public/v1/merchants/4ef08825-993a-424d-a769-3ee97116a1b6/orders/F1499C097FFA533D46FB05D52680AB9A/additional_data
 
< Http 200 Ok