Update order (reversing)
Update an order where existing items are reversed and new items are added.
Create order
- POST /v1/accounts/{aid}/shopping/draft_orders
- PUT /v1/accounts/{aid}/shopping/draft_orders/{id}/complete
{
"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
- POST /v1/accounts/{aid}/shopping/orders/{order_id}/authorizations
- POST /v1/accounts/{aid}/shopping/orders/{order_id}/captures
{
"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.
- POST /v1/accounts/{aid}/shopping/draft_orders
- PUT /v1/accounts/{aid}/shopping/draft_orders/{id}/complete
{
"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
- POST /v1/accounts/{aid}/shopping/orders/{order_id}/authorizations
- POST /v1/accounts/{aid}/shopping/orders/{order_id}/captures
{
"items": [
{
"amount": -39800,
"line_id": 2
}
],
"payment_details": {
"payment_id": "PID_123"
},
"success": true
}
Authorize and capture the new item
- POST /v1/accounts/{aid}/shopping/orders/{order_id}/authorizations
- POST /v1/accounts/{aid}/shopping/orders/{order_id}/captures
{
"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
- POST /v1/accounts/{aid}/shopping/orders/{order_id}/authorizations
- POST /v1/accounts/{aid}/shopping/orders/{order_id}/captures
{
"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
- POST /v1/accounts/{aid}/shopping/orders/{order_id}/authorizations
- POST /v1/accounts/{aid}/shopping/orders/{order_id}/captures
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
}