v1

latestOpenAPI 3.0.12026-08-0616103195.0 KB
Cancellation

Cancel transaction

Cancel a previously authorized transaction

post/v2/transactions/{ratepay_transaction_id}/cancellations

Path parameters

ratepay_transaction_idstring required

ID of transaction to cancel. Get an overview of key identifiers used in payment API.

Headers

Idempotency-Keystring

ID generated by client to uniquely identify the request. It is highly recommended to use a UUID version 4. Do not reuse an idempotency key for different calls. See Idempotency for further details.

Prefer'return=representation'

According to RFC 7240: Provide return=representation if you prefer that the response to a request includes the current state of the resource.

X-Partnerstring

The partner ID for the operation is required only when using a single credential set for multiple integrations, such as countries or brands associated with one company.

Request body

gross_amountnumber required

Amount to cancel given in currency of original transaction.

partner_operation_idstring

The unique ID generated by the partner or shop to identify an API operation. This ID can be displayed in settlement reports to allow relating settlement report items to API operations. Get an overview of key identifiers used in payment API.

partner_shop_idstring

The shop ID provided upfront by Ratepay or generated by the partner in PSP (payment service providers) scenarios. Get an overview of key identifiers used in payment API. This field is required in case of marketplace transaction.

Example request

{
  "gross_amount": 67.6,
  "items": [
    {
      "article_number": "kitchen-utils-1",
      "category": "household",
      "description": "fruit knife with curved blade, 8 cm",
      "gross_total_price": 33.8,
      "gross_unit_discount": -1.55,
      "gross_unit_price": 18.45,
      "name": "fruit knife",
      "net_total_price": 28.4,
      "net_unit_discount": -1.3,
      "net_unit_price": 15.5,
      "quantity": 2,
      "tax_rate": 19,
      "unit": "piece"
    }
  ],
  "partner_operation_id": "cancel-id-1234",
  "partner_shop_id": "partner-shop-id-1",
  "special_items": [
    {
      "article_number": "SHIPPING_001",
      "category": "shipping",
      "description": "Standard shipping via DHL",
      "gross_total_price": 5.95,
      "gross_unit_price": 5.95,
      "name": "Shipping costs",
      "net_total_price": 5,
      "net_unit_price": 5,
      "quantity": 1,
      "tax_rate": 19,
      "unit": "shipment"
    }
  ],
  "vats": [
    {
      "net_amount": 56.81,
      "tax_amount": 10.79,
      "tax_rate": 19
    }
  ]
}

Response

Cancellation created