Cancel Payment Request
When a payment request is not accepted or rejected it can be cancelled by payment request id. Lines should not be provided in this case.
When a payment request is accepted but not all order lines have been delivered (captured), the pending lines that won't be fulfilled anymore can be cancelled by providing the line reference and quantity. Optionally the Cancel Request can have a reference id. See request below
URL
POST
/merchant-api/v2/cancel
HTTP response codes
200
- Successful operation400
- Number of items to cancel must be a positive number / Merchant line references must be unique / Please supply at least one cancel line / MerchantCancelReferenceId is not allowed401
- Unauthorized, maybe the credentials are missing. For more information, see security403
- Forbidden, the HMAC may be wrong or out of date. For more information, see security404
- Payment request for given ID does not exist409
- Payment request cannot be cancelled / Could not cancel the requested lines. [Reason message] / Not allowed to cancel pending lines based on current configuration
Request
Attribute | Type | Length | Description |
---|---|---|---|
paymentRequestId required | String | 36 | A reference to the original payment request id. It is a UUID. |
cancelLines | List of Lines (below) | Required for cancelling pending lines. | |
merchantCancelReferenceId | String | 100 | Nice to have for cancelling pending order lines. |
Lines
Attribute | Type | Length | Description |
---|---|---|---|
merchantLineReference required | String | 100 | The reference to the original line in the payment request |
numberOfItems required | Int | The number of items to be refunded |
Example
Request
{
paymentRequestId: '01234567-aaaa-bbbb-cccc-987654321abc';
}
Request with cancel lines
{
paymentRequestId: "01234567-aaaa-bbbb-cccc-987654321abc",
cancelLines: [{
merchantLineReference: "Example_0000001",
numberOfItems: 1
}]
}