Skip to main content

Update order (reversing)

Update an order where existing items are reversed and new items are added.

Create order

{
"options": {
"generate_order_id": "ALPHANUMERIC_9"
},
"order": {
"currency": "NOK",
"items": [
{
"id": "175938",
"line_id": 1,
"quantity": 2,
"gross_amount": 39800,
"tax_lines": [
{
"amount": 7960,
"percentage": 25
}
],
"description": "Stablestol for utendørsbruk",
"description_alias": "Staplestol"
}
]
}
}

Authorize and capture the order

{
"items": [
{
"amount": 39800,
"line_id": 1
}
],
"payment_details": {
"payment_id": "PID_123"
},
"success": true
}

Reverse order item and add new item

Update existing order, removing (reversing) existing item and adding a new item.

{
"options": {
"order_id": "{order_id}"
},
"order": {
"currency": "NOK",
"items": [
{
"id": "175938",
"line_id": 2,
"quantity": 2,
"gross_amount": -39800,
"tax_lines": [
{
"amount": -7960,
"percentage": 25
}
],
"description": "Stablestol for utendørsbruk",
"description_alias": "Staplestol",
"reversed_reason": "Replace item",
"related_item": {
"line_id": 1,
"type": "reversed"
}
},
{
"id": "003929",
"line_id": 3,
"quantity": 1,
"gross_amount": 39800,
"tax_lines": [
{
"amount": 7960,
"percentage": 25
}
],
"description": "Stablestol for innendørsbruk",
"description_alias": "Staplestol Lux"
}
]
}
}

use related_item to link the item that is being reversed

Authorize and capture reversed item

{
"items": [
{
"amount": -39800,
"line_id": 2
}
],
"payment_details": {
"payment_id": "PID_123"
},
"success": true
}

Authorize and capture the new item

{
"items": [
{
"amount": 39800,
"line_id": 3
}
],
"payment_details": {
"payment_id": "PID_123"
},
"success": true
}

Refund remaining

We recommend that an additional item is included in the draft update if the original authorization is higher than the new items.

Authorize and capture the new item + refund line

{
"items": [
{
"amount": 39800,
"line_id": 3
},
{
"amount": 1000,
"line_id": 4
}
],
"payment_details": {
"payment_id": "PID_123"
},
"success": true
}

Refund remaining authorization

{
"items": [
{
"amount": 1000,
"line_id": 4
}
],
"payment_details": {
"payment_id": "PID_123"
},
"success": true
}

Part authorization / captures

We recommend that additional authorization/captures is added to the new item if the original authorization/capture below the new item amount

Support for multiple authorization (same item) is planned for 2021-06-01

{
"items": [
{
"amount": 1000,
"line_id": 3
}
],
"payment_details": {
"payment_id": "PID_321"
},
"success": true
}