API for cart and orders
- new support filter orders by:
itinerary_travel_mode
,itinerary_arrival_address
,itinerary_departure_address
anditems_discount_lines_discount_type
.
- Extend the Order itinerary with new properties
- Add support for
route_id
andvehicle_id
.- Add support for
external_ids
inarrival_address
anddeparture_address
- new suport
include_events
when updating an order
- new endpoint for deleting comment
- Request for creating authorization, capture, refund or cancellation can fail with
409 Conflict
error.
- Extend the draft options to specify TTL for the order Use
options.order_time_to_live
to set expiry for when the order and its draft data will be removed.
- Extend payment operations items to include
payout
for order items that have a payout rule The new property shows how the payment operation item amounts should be splitt by its payout rule destinations
- Extend endpoint for listing draft and orders to support currency filter
- Extend the draft options to support replace of existing order. Use
options.replace="order"
option to replace an order when the draft is completed. This option is only valid for existing orders that have no payment operations registered (when draft is completed)
Extend
include_events
query parameter to support multiple values. The parameter accept now:
false
true
api-event
service-event
.
api-event
will be excluded from the store/customer endpoints:
- Support adding comments to an order
- Extend the draft options to allow alphanumeric short order_id. Use
options.generate_order_id
to control the ID format for generatedorder.order_id
.
- Create order with custom order_id. The new property is only supported when creating draft with
split_draft=false
. Theorder.order_id
will be set toorder.id
if no order_id is provied.
- Extend endpoint for listing draft and orders to support filtering
- Extend order with
external_ids
- Extend order with
external_links
.
- Extend order itinerary and attachments
- Add
name
andid
to itineraryarrival_address
and `departure_address. Make all address properties options- Add
line_ids
andid
to itinerary and attachments- Add
operator
to itinerary- Extend
itinerary.travel_mode
withCUSTOM
- Extend order events with
event_type
to support event typesapi-event
andservice-event
.
- Extend order event with
draft_id
, a readOnly property that are included in events where the order was created or updated by a draft.
- Extend order with
itinerary
andattachment
for including travel details
- Extern order items with readOnly
version
property that will be set when the draft order item is added or updated.
- Extend order payment operation definition with
processed_by
andpayment_details
.
- Extend the draft options to allow more control for how payout is configured
- Extend the draft order items to support including
manual_payout
to support use of any payout rule when calculating the split for the order items.
- Extend order item with
attachment
. Add support for including details about car, bus and train reservation as attachment in order items.
- Add
events
to draft. A event will be added to the draft events list when the draft is updated.- Add
payout
option to enable calculating the payout for the order items store id. See Billing API- Add support for dynamic payout rules via
options.payout.rules
.- Add
order_id
option to allow creating a draft that will be added to an existing order.- Add
split_draft
option to allow one-to-many mapping between draft and order- Add support for including store when creating a draft.
- Add support for adding draft items with
reversed_reason
property. Use the property in case when an item should be reversed and the payment refunded.- Add support for item
related_item.type=reversed
, that should be used when reversing an existing item.- Add support for negative item
gross_amount
to support reversing items.
- Include authorizations and cancellations in order details
- Include
payment_details
to the order.
sessions Add support for creating sessions for and order
refunds Require items to be specified when creating a refund
captures Require items to be specified when creating a capture
cancellations Add support for creating cancellations for an order
authorizations Add support for creating authorizations for an order
orders Extend order definitions with Discounts
orders store orders add support for
include_events
on order requests. The order eventstate
andevents
list will be included in the response.
- extend draft definition with optional
options.serial_order_number_suffix
property.
- extend order definition with
courier_id
andpickup_at
that can be set and updated after the order is created- extend order definition with
delivery_id
that can be set after the the order is created- extend order definition with optional
pre_order
property- extend order definition with optional
type
property.- extend order shipping_address and billing_address property with optional
comment
property that can be used for additional information needed for the address.
- allow scopes
read:shopping:/orders/ANY/events
write:shopping:/orders/ANY/events
- filter by
status
: open, completed, deleted- filter by
created_at.gte
andcreated_at.lte
- filter by
status
: open, closed, cancelled- filter by
payment_status
: pending, partially_paid, paid, partially_refunded, refunded- filter by
created_at.gte
andcreated_at.lte
- filter by
status
: open, closed, cancelled- filter by
payment_status
: pending, partially_paid, paid, partially_refunded, refunded- filter by
created_at.gte
andcreated_at.lte
- filter by
status
: open, closed, cancelled- filter by
payment_status
: pending, partially_paid, paid, partially_refunded, refunded- filter by
created_at.gte
andcreated_at.lte
- accept any
customer.id
format
- require
amount
andprocessed_at
when creating a refund- require
amount
andprocessed_at
when creating a capture
- Add endpoint for list orders for a store
- Add endpoint for get order for a store
- Remove uuid format requirement on customer_id path parameter
- remove support for
apply_discounts
query parameter, the parameter will only be supported from endpoints updating the draft order.
- change the response to include one or more orders created from the draft.
Rename the API, Shopping API, all endpoints will now be prefixed with
/v1/accounts/{aid}/shopping/
- Add
salesperson_id
andsalesperson_name
properties- Add
delivery_at
property for specifying when the order should be delivered (in the future)
- Require
percentage
intax_lines
for an order item- Add
quantity
property toitem.additions
, and allow negativegross_amount
- Add
related_item
property that can be used to create a relationship between two items- Add
description_alias
, shorter item description for receipt- Add
salesperson_id
andsalesperson_name
property
- Add
metadata
property that can be used to included additional key/values on order items.- Add
additions
array property. The property can be used to describe customization the customer want to be included with the order item.- Add
comment
property for recording customer comments on the item
- Add
comment
property for recording customer comments on the order
Use webhooks to get notification on shopping events. See Create new subscription for details on how to create a webhooks subscription
Following event types are supported
Event | Description |
---|---|
shopping_draft_add |
new draft order created |
shopping_draft_update |
existing draft order updated |
shopping_draft_complete |
draft completed, includes orders created |
shopping_order_update |
existing order updated |
shopping_order_event_add |
new event added to order |
Bearer authentication (also called token authentication) should be used when accessing the API.
Use Get Token to get an access token
Authorization by using the Bearer schema The content of the header should look like the following:
Authorization: Bearer {access_token}
where the access_token is JSON Web Tokens (JWT).
Security Scheme Type | API Key |
---|---|
Header parameter name: | Authorization |
Use this resource to create orders in draft state.
scopes:
aid required | string <^[PT]{1}\d{8}$> 9 characters An id that uniquely identifies the account. |
apply_discounts | boolean Default: false Calculate available discounts and apply them to the order. Requires additional scope for accessing the DealEngine, one of
The
|
draft order resource
required | object |
object |
{- "options": {
- "order_time_to_live": 94672800,
- "generate_order_id": "UUID",
- "order_id": "string",
- "replace": "order",
- "payout": {
- "rules": [
- {
- "rule_type": "order.items.store.id",
- "rule_id": "sc029",
- "destinations": [
- {
- "type": "percentage",
- "value": 10,
- "destinations": [
- {
- "type": "flat_amount",
- "value": "500",
- "destination": "account-a"
}, - {
- "type": "remaining_amount",
- "destinations": [
- {
- "type": "percentage",
- "value": "5.0",
- "destination": "account-b"
}
]
}
]
}, - {
- "type": "flat_amount",
- "value": "500",
- "destination": "account-a"
}, - {
- "type": "remaining_amount",
- "destinations": [
- {
- "type": "percentage",
- "value": "5",
- "destination": "account-b"
}, - {
- "type": "percentage",
- "value": "95.0",
- "destination": "account-c"
}
]
}
], - "metadata": { }
}
], - "resolve_rule_id": "order.items.store.id",
- "resolve_rule_type": "string"
}, - "split_draft": false,
- "serial_order_number_suffix": false
}, - "order": {
- "customer": {
- "first_name": "John",
- "last_name": "Doe",
- "id": "string",
- "gender": "male",
- "email": "customer@example.com",
- "metadata": {
- "dob_year": 1985
}, - "phone_number": "+4799999999",
- "addresses": [
- {
- "address_line":