{

Refunds

Refund an already processed payment.

Refund an already processed payment

Starts a new Refund for given Order, Payment and a Merchant.

POST /ps/api/public/v1/merchants/{merchant_key}/orders/{order_key}/payments/{payment_id}/refunds

Identifiers

Name Description
merchant_key The key of the merchant.
order_key The key of the order
payment_id The payment identifier

Parameters

Not applicable.

Request

Field Type M Description
refund_reference String O The refund reference from the merchant.
description String O The description for the refund.
amount Number O The refund amount in minor units, e.g. in cents.
currency String C The refund amount currency as ISO 4217 Alpha 3, e.g. "EUR".
Must be present if the refund amount is given.
refund_required_date String O The date the payment must be captured for refund in the format yyyy-MM-dd

Response

Field Type M Description
merchant_request_key String M Unique identifier for the refund request made.
refund_amount String M The amount which is captured for a refund.

HTTP Status

Status Meaning
201 (Created) The refund is successfully created.
400 (Bad Request) The request was not valid.
Examples: Currency is not provided when amount is provided OR payment is not yet captured, or (partial) refund not allowed on the route.
403 (Forbidden) The merchant key is not allowed.
404 (Not Found) The transaction key or the payment id not found.

Refund payment 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/3B88E0EF13E37D6A56AE949AD9E56961/payments/pid2163179782t/refunds \
    -d '{
        "refund_reference": "refund-1",
        "description"     : "Refund a Payment",
        "amount"          : 1000,
        "currency"        : "EUR",
        "refund_required_date" : "2020-08-31"
    }'

< Http 201 Created
<    '{
        "merchant_request_key"        : "mrr650649665r",
        "refund_amount"    : 1000
    }'