Shopping API (2019-02-13-SNAPSHOT)

Download OpenAPI specification:Download

API Integration Support: integration@dintero.com License: UNLICENSED

API for cart and orders

Changelog

All notable changes to the API.

2019-07-01

orders Extend order definitions with Discounts

orders store orders add support for include_events on order requests. The order event state and events list will be included in the response.

2019-06-01

draft orders

  • extend draft definition with optional options.serial_order_number_suffix property.

orders

  • extend order definition with courier_id and pickup_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.

events

  • allow scopes
    • read:shopping:/orders/ANY/events
    • write:shopping:/orders/ANY/events

2019-05-01

draft orders

  • filter by status: open, completed, deleted
  • filter by created_at.gte and created_at.lte

customer orders

  • filter by status: open, closed, cancelled
  • filter by payment_status: pending, partially_paid, paid, partially_refunded, refunded
  • filter by created_at.gte and created_at.lte

store orders

  • filter by status: open, closed, cancelled
  • filter by payment_status: pending, partially_paid, paid, partially_refunded, refunded
  • filter by created_at.gte and created_at.lte

orders

  • filter by status: open, closed, cancelled
  • filter by payment_status: pending, partially_paid, paid, partially_refunded, refunded
  • filter by created_at.gte and created_at.lte
  • accept any customer.id format

order payments

2019-04-01

store orders

customer orders

  • Remove uuid format requirement on customer_id path parameter

complete draft order

  • remove support for apply_discounts query parameter, the parameter will only be supported from endpoints updating the draft order.

2019-03-02

complete 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/

order

  • Add salesperson_id and salesperson_name properties
  • Add delivery_at property for specifying when the order should be delivered (in the future)

order item

  • Require percentage in tax_lines for an order item
  • Add quantity property to item.additions, and allow negative gross_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 and salesperson_name property

2019-02-27

order item

  • 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

order

  • Add comment property for recording customer comments on the order

Webhooks

Use webhooks to get notification on shopping events. See Create new subscription for details on how to create a webhooks subscription

Events

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

Authentication

JWT

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

Customer Orders

Orders collection

get /accounts/{aid}/shopping/customers/{customer_id}/orders
https://api.dintero.com/v1/accounts/{aid}/shopping/customers/{customer_id}/orders
https://test.dintero.com/v1/accounts/{aid}/shopping/customers/{customer_id}/orders

Retrieve a list of orders belonging to a customer user

scopes:

  • user:shopping
  • admin:shopping
  • read:shopping
path Parameters
aid
required
string <^[PT]{1}\d{8}$> 9 characters

An id that uniquely identifies the account.

customer_id
required
string

The resource identifier string

query Parameters
starting_after
string <uuid>

cursor for use in pagination. starting_after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include starting_after=obj_foo in order to fetch the next page of the list.

limit
integer [ 1 .. 100 ]
Default: 10

A limit on the number of objects to be returned. Limit can range between 1 and 100 items, and the default is 10 items.

status
string
Enum:"open" "closed" "cancelled"

filter by order status

payment_status
string
Enum:"pending" "partially_paid" "paid" "partially_refunded" "refunded"

filter by payment status

created_at.gte
string <date>

filter by created_at, greater than or equal (after)

created_at.lte
string <date>

filter by created_at, less than or equal (before)

include_events
boolean
Default: false

include order events in response

Responses

200

order collection

Response Schema: application/json
orders
required
Array of object (Order)
400

Bad / Invalid request

401

Access forbidden, invalid JWT token was used

403

Forbidden

500

Unexpected Error

Response samples

application/json
Copy
Expand all Collapse all
{
  • "orders":
    [
    ]
}

Get Order

get /accounts/{aid}/shopping/customers/{customer_id}/orders/{order_id}
https://api.dintero.com/v1/accounts/{aid}/shopping/customers/{customer_id}/orders/{order_id}
https://test.dintero.com/v1/accounts/{aid}/shopping/customers/{customer_id}/orders/{order_id}

Retrieve Order details for an customer

scopes:

  • user:shopping
  • admin:shopping
  • read:shopping
path Parameters
aid
required
string <^[PT]{1}\d{8}$> 9 characters

An id that uniquely identifies the account.

customer_id
required
string

The resource identifier string

order_id
required
string <uuid>

The resource identifier string

query Parameters
include_events
boolean
Default: false

include order events in response

Responses

200

order

Response Schema: application/json
object Order Recursive
401

Access forbidden, invalid JWT token was used

403

Forbidden

404

Resource was not found

500

Unexpected Error

Response samples

application/json
Copy
Expand all Collapse all
{
  • "id": "bd04c959-d159-49b4-a096-2d84e014a8da",
  • "created_at": "2019-06-21T14:38:21Z",
  • "created_by": "bd04c959-d159-49b4-a096-2d84e014a8da",
  • "cancelled_reason": "customer",
  • "cancelled_by": "bd04c959-d159-49b4-a096-2d84e014a8da",
  • "cancelled_at": "2019-06-21T14:38:21Z",
  • "closed_by": "bd04c959-d159-49b4-a096-2d84e014a8da",
  • "closed_at": "2019-06-21T14:38:21Z",
  • "status": "open",
  • "payment_status": "pending",
  • "type": "delivery",
  • "order_number": "order123456",
  • "customer":
    {
    },
  • "currency": "NOK",
  • "gross_amount": 59800,
  • "net_amount": 47840,
  • "total_discount": 23130,
  • "total_manual_discount_amount": 0,
  • "amount_due": 0,
  • "items":
    [
    ],
  • "shipping_address":
    {
    },
  • "billing_address":
    {
    },
  • "metadata": { },
  • "comment": "string",
  • "salesperson_id": "string",
  • "salesperson_name": "string",
  • "delivery_at": "2019-06-21T14:38:21Z",
  • "pickup_at": "2019-06-21T14:38:21Z",
  • "courier_id": "string",
  • "pre_order": true,
  • "captures":
    [
    ],
  • "refunds":
    [
    ],
  • "discounts":
    [
    ],
  • "delivery_id": "string",
  • "store":
    {
    },
  • "_links":
    [
    ],
  • "state": "string",
  • "events":
    [
    ]
}

Draft

Draft orders collection

get /accounts/{aid}/shopping/draft_orders
https://api.dintero.com/v1/accounts/{aid}/shopping/draft_orders
https://test.dintero.com/v1/accounts/{aid}/shopping/draft_orders

Retrieve a list of draft orders

scopes:

  • admin:shopping
  • read:shopping
path Parameters
aid
required
string <^[PT]{1}\d{8}$> 9 characters

An id that uniquely identifies the account.

query Parameters
starting_after
string <uuid>

cursor for use in pagination. starting_after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include starting_after=obj_foo in order to fetch the next page of the list.

limit
integer [ 1 .. 100 ]
Default: 10

A limit on the number of objects to be returned. Limit can range between 1 and 100 items, and the default is 10 items.

customer_id
string

The resource identifier string

status
string
Enum:"open" "completed" "deleted"

filter by draft order status

created_at.gte
string <date>

filter by created_at, greater than or equal (after)

created_at.lte
string <date>

filter by created_at, less than or equal (before)

Responses

200

draft order collection

Response Schema: application/json
draft_orders
required
Array of object (DraftOrder)
400

Bad / Invalid request

401

Access forbidden, invalid JWT token was used

403

Forbidden

500

Unexpected Error

Response samples

application/json
Copy
Expand all Collapse all
{
  • "draft_orders":
    [
    ]
}

Create a draft order

post /accounts/{aid}/shopping/draft_orders
https://api.dintero.com/v1/accounts/{aid}/shopping/draft_orders
https://test.dintero.com/v1/accounts/{aid}/shopping/draft_orders

Use this resource to create orders in draft state.

scopes:

  • admin:shopping
  • write:shopping
path Parameters
aid
required
string <^[PT]{1}\d{8}$> 9 characters

An id that uniquely identifies the account.

query Parameters
apply_discounts
boolean
Default: false

Calculate available discounts and apply them to the order.

Requires additional scope for accessing the DealEngine, one of

  • admin:discounts
  • write:discounts
  • write:discounts:/available_for_receipt

The tax_lines will be updated if apply_discount results in new net_amount.

  • net_amount = gross_amount - Σ discount_lines.amount

tax_line.amount will be calculated from tax_line.percentage and net_amount.

Request Body schema: application/json

draft order resource

order
required
object
options
object

Responses

201

draft order was created

Response Schema: application/json
order
required
object
id
string <= 40 characters

The resource ID. Defaults to UUID v4

created_at
string <date-time>

The date-time when the resource was created

created_by
string <= 40 characters

The ID of the user/client created the resource

updated_at
string <date-time>

The date-time when the resource was last updated

deleted_by
string <= 40 characters

The ID of the user/client created the resource

deleted_at
string <date-time>

Read-only timestamp, automatically assigned on back-end.

status
string
Default: "open"
Enum:"open" "completed" "deleted"

The status of the DraftOrder as it transitions into an Order.

Status is set to completed when the DraftOrder is completed and an Order is created

After a DraftOrder is set to completed the only further modification that can be made are adding notes or metadata fields

_links
Array of object (Link) non-empty

The links related to resource

options
object
400

Bad / Invalid request

401

Access forbidden, invalid JWT token was used

403

Forbidden

500

Unexpected Error

Request samples

application/json
Copy
Expand all Collapse all
{
  • "options":
    {
    },
  • "order":
    {
    }
}

Response samples

application/json
Copy
Expand all Collapse all
{
  • "id": "bd04c959-d159-49b4-a096-2d84e014a8da",
  • "created_at": "2019-06-21T14:38:21Z",
  • "created_by": "bd04c959-d159-49b4-a096-2d84e014a8da",
  • "updated_at": "2019-06-21T14:38:21Z",
  • "deleted_by": "bd04c959-d159-49b4-a096-2d84e014a8da",
  • "deleted_at": "2019-06-21T14:38:21Z",
  • "status": "open",
  • "_links":
    [
    ],
  • "options":
    {
    },
  • "order":
    {
    }
}

Get draft order

get /accounts/{aid}/shopping/draft_orders/{id}
https://api.dintero.com/v1/accounts/{aid}/shopping/draft_orders/{id}
https://test.dintero.com/v1/accounts/{aid}/shopping/draft_orders/{id}

Get draft order.

scopes:

  • admin:shopping
  • read:shopping
path Parameters
aid
required
string <^[PT]{1}\d{8}$> 9 characters

An id that uniquely identifies the account.

id
required
string <uuid>

The resource identifier string

Responses

200

draft order

Response Schema: application/json
order
required
object
id
string <= 40 characters

The resource ID. Defaults to UUID v4

created_at
string <date-time>

The date-time when the resource was created

created_by
string <= 40 characters

The ID of the user/client created the resource

updated_at
string <date-time>

The date-time when the resource was last updated

deleted_by
string <= 40 characters

The ID of the user/client created the resource

deleted_at
string <date-time>

Read-only timestamp, automatically assigned on back-end.

status
string
Default: "open"
Enum:"open" "completed" "deleted"

The status of the DraftOrder as it transitions into an Order.

Status is set to completed when the DraftOrder is completed and an Order is created

After a DraftOrder is set to completed the only further modification that can be made are adding notes or metadata fields

_links
Array of object (Link) non-empty

The links related to resource

options
object
401

Access forbidden, invalid JWT token was used

403

Forbidden

404

Resource was not found

500

Unexpected Error

Response samples

application/json
Copy
Expand all Collapse all
{
  • "id": "bd04c959-d159-49b4-a096-2d84e014a8da",
  • "created_at": "2019-06-21T14:38:21Z",
  • "created_by": "bd04c959-d159-49b4-a096-2d84e014a8da",
  • "updated_at": "2019-06-21T14:38:21Z",
  • "deleted_by": "bd04c959-d159-49b4-a096-2d84e014a8da",
  • "deleted_at": "2019-06-21T14:38:21Z",
  • "status": "open",
  • "_links":
    [
    ],
  • "options":
    {
    },
  • "order":
    {
    }
}

Update draft order

put /accounts/{aid}/shopping/draft_orders/{id}
https://api.dintero.com/v1/accounts/{aid}/shopping/draft_orders/{id}
https://test.dintero.com/v1/accounts/{aid}/shopping/draft_orders/{id}

Updates a draft order.

scopes:

  • admin:shopping
  • write:shopping
path Parameters
aid
required
string <^[PT]{1}\d{8}$> 9 characters

An id that uniquely identifies the account.

id
required
string <uuid>

The resource identifier string

query Parameters
apply_discounts
boolean
Default: false

Calculate available discounts and apply them to the order.

Requires additional scope for accessing the DealEngine, one of

  • admin:discounts
  • write:discounts
  • write:discounts:/available_for_receipt

The tax_lines will be updated if apply_discount results in new net_amount.

  • net_amount = gross_amount - Σ discount_lines.amount

tax_line.amount will be calculated from tax_line.percentage and net_amount.

Request Body schema: application/json

draft order resource

order
required
object
options
object

Responses

202

draft order was updated

400

Bad / Invalid request

401

Access forbidden, invalid JWT token was used

403

Forbidden

404

Resource was not found

500

Unexpected Error

Request samples

application/json
Copy
Expand all Collapse all
{
  • "options":
    {
    },
  • "order":
    {
    }
}

Response samples

application/json
Copy
Expand all Collapse all
{
  • "id": "bd04c959-d159-49b4-a096-2d84e014a8da",
  • "created_at": "2019-06-21T14:38:21Z",
  • "created_by": "bd04c959-d159-49b4-a096-2d84e014a8da",
  • "updated_at": "2019-06-21T14:38:21Z",
  • "deleted_by": "bd04c959-d159-49b4-a096-2d84e014a8da",
  • "deleted_at": "2019-06-21T14:38:21Z",
  • "status": "open",
  • "_links":
    [
    ],
  • "options":
    {
    },
  • "order":
    {
    }
}

Complete a draft order

put /accounts/{aid}/shopping/draft_orders/{id}/complete
https://api.dintero.com/v1/accounts/{aid}/shopping/draft_orders/{id}/complete
https://test.dintero.com/v1/accounts/{aid}/shopping/draft_orders/{id}/complete

Use this resource to transition the draft order into an Order. A draft with multiple sales locations will transition into one order per sales location.

scopes:

  • admin:shopping
  • write:shopping
path Parameters
aid
required
string <^[PT]{1}\d{8}$> 9 characters

An id that uniquely identifies the account.

id
required
string <uuid>

The resource identifier string

Request Body schema: application/json

draft order resource

Responses

200

Draft completed

Response Schema: application/json
orders
required
Array of object (Order) non-empty
id
string <= 40 characters

The resource ID. Defaults to UUID v4

created_at
string <date-time>

The date-time when the resource was created

created_by
string <= 40 characters

The ID of the user/client created the resource

updated_at
string <date-time>

The date-time when the resource was last updated

deleted_by
string <= 40 characters

The ID of the user/client created the resource

deleted_at
string <date-time>

Read-only timestamp, automatically assigned on back-end.

status
string
Default: "open"
Enum:"open" "completed" "deleted"

The status of the DraftOrder as it transitions into an Order.

Status is set to completed when the DraftOrder is completed and an Order is created

After a DraftOrder is set to completed the only further modification that can be made are adding notes or metadata fields

_links
Array of object (Link) non-empty

The links related to resource

400

Bad / Invalid request

401

Access forbidden, invalid JWT token was used

403

Forbidden

404

Resource was not found

500

Unexpected Error

Request samples

application/json
Copy
Expand all Collapse all
{ }

Response samples

application/json
Copy
Expand all Collapse all
{
  • "id": "bd04c959-d159-49b4-a096-2d84e014a8da",
  • "created_at": "2019-06-21T14:38:21Z",
  • "created_by": "bd04c959-d159-49b4-a096-2d84e014a8da",
  • "updated_at": "2019-06-21T14:38:21Z",
  • "deleted_by": "bd04c959-d159-49b4-a096-2d84e014a8da",
  • "deleted_at": "2019-06-21T14:38:21Z",
  • "status": "open",
  • "_links":
    [
    ],
  • "orders":
    [
    ]
}

Draft Items

Add item to draft

post /accounts/{aid}/shopping/draft_orders/{id}/items
https://api.dintero.com/v1/accounts/{aid}/shopping/draft_orders/{id}/items
https://test.dintero.com/v1/accounts/{aid}/shopping/draft_orders/{id}/items

Updates a draft with new item

scopes:

  • admin:shopping
  • write:shopping
path Parameters
aid
required
string <^[PT]{1}\d{8}$> 9 characters

An id that uniquely identifies the account.

id
required
string <uuid>

The resource identifier string

query Parameters
apply_discounts
boolean
Default: false

Calculate available discounts and apply them to the order.

Requires additional scope for accessing the DealEngine, one of

  • admin:discounts
  • write:discounts
  • write:discounts:/available_for_receipt

The tax_lines will be updated if apply_discount results in new net_amount.

  • net_amount = gross_amount - Σ discount_lines.amount

tax_line.amount will be calculated from tax_line.percentage and net_amount.

Request Body schema: application/json

draft line item resource

gross_amount
required
integer >= 0

Monetary amount in smallest unit for the currency before discounts

tax_lines
required
Array of object (TaxItem) non-empty
line_id
integer

The number of the line (or id), must be unique between all items.

quantity
number
Default: 1

The quantity of the product in the item line.

id
string

The ID or SKU of the product on the line

groups
Array of object

The groups the product on the line belongs to

description
string
description_alias
string

Short description / title of the product

metadata
object

Additional details about the item, key values will be included as extra_info in the receipt.

eligible_for_discount
boolean
dimension
object (Dimension)

Identify item attributes, such as size and color

discount_lines
Array of object (DiscountItem)
additions
Array of object

Additions, customization of the item. The gross_amount for an addition should be included in the item gross_amount and included in the tax_lines if applicable.

store
object
related_item
object

Relationship with another line item.

An item with a required relationship with another line item will be removed from the order if the related line is removed

An item with optional relationship will remain in the order if the related line is removed, the related_item will be cleared as the line it relates to does not exist anymore

salesperson_id
string

Id of the sales person if other then the operator

salesperson_name
string

Name of the sales person

comment
string <= 255 characters

comment on the item

Responses

202

draft order was updated

400

Bad / Invalid request

401

Access forbidden, invalid JWT token was used

403

Forbidden

404

Resource was not found

500

Unexpected Error

Request samples

application/json
Copy
Expand all Collapse all
{
  • "id": "175938",
  • "metadata": { },
  • "groups":
    [
    ],
  • "line_id": 1,
  • "quantity": 2,
  • "gross_amount": 39800,
  • "tax_lines":
    [
    ],
  • "description": "Stablestol for utendørsbruk",
  • "description_alias": "Staplestol",
  • "eligible_for_discount": true,
  • "dimension":
    {
    },
  • "discount_lines":
    [
    ],
  • "additions":
    [
    ],
  • "store":
    {
    },
  • "related_item":
    {
    },
  • "salesperson_id": "string",
  • "salesperson_name": "string",
  • "comment": "string"
}

Response samples

application/json
Copy
Expand all Collapse all
{
  • "id": "bd04c959-d159-49b4-a096-2d84e014a8da",
  • "created_at": "2019-06-21T14:38:21Z",
  • "created_by": "bd04c959-d159-49b4-a096-2d84e014a8da",
  • "updated_at": "2019-06-21T14:38:21Z",
  • "deleted_by": "bd04c959-d159-49b4-a096-2d84e014a8da",
  • "deleted_at": "2019-06-21T14:38:21Z",
  • "status": "open",
  • "_links":
    [
    ],
  • "options":
    {
    },
  • "order":
    {
    }
}

Remove item from draft

delete /accounts/{aid}/shopping/draft_orders/{id}/items/{line_id}
https://api.dintero.com/v1/accounts/{aid}/shopping/draft_orders/{id}/items/{line_id}
https://test.dintero.com/v1/accounts/{aid}/shopping/draft_orders/{id}/items/{line_id}

Remove a item line from the draft

scopes:

  • admin:shopping
  • write:shopping
path Parameters
aid
required
string <^[PT]{1}\d{8}$> 9 characters

An id that uniquely identifies the account.

id
required
string <uuid>

The resource identifier string

line_id
required
integer

The resource identifier string

query Parameters
apply_discounts
boolean
Default: false

Calculate available discounts and apply them to the order.

Requires additional scope for accessing the DealEngine, one of

  • admin:discounts
  • write:discounts
  • write:discounts:/available_for_receipt

The tax_lines will be updated if apply_discount results in new net_amount.

  • net_amount = gross_amount - Σ discount_lines.amount

tax_line.amount will be calculated from tax_line.percentage and net_amount.

Responses

202

draft order was updated

400

Bad / Invalid request

401

Access forbidden, invalid JWT token was used

403

Forbidden

404

Resource was not found

500

Unexpected Error

Response samples

application/json
Copy
Expand all Collapse all
{
  • "id": "bd04c959-d159-49b4-a096-2d84e014a8da",
  • "created_at": "2019-06-21T14:38:21Z",
  • "created_by": "bd04c959-d159-49b4-a096-2d84e014a8da",
  • "updated_at": "2019-06-21T14:38:21Z",
  • "deleted_by": "bd04c959-d159-49b4-a096-2d84e014a8da",
  • "deleted_at": "2019-06-21T14:38:21Z",
  • "status": "open",
  • "_links":
    [
    ],
  • "options":
    {
    },
  • "order":
    {
    }
}

Update item in draft

put /accounts/{aid}/shopping/draft_orders/{id}/items/{line_id}
https://api.dintero.com/v1/accounts/{aid}/shopping/draft_orders/{id}/items/{line_id}
https://test.dintero.com/v1/accounts/{aid}/shopping/draft_orders/{id}/items/{line_id}

Update item in draft

scopes:

  • admin:shopping
  • write:shopping
path Parameters
aid
required
string <^[PT]{1}\d{8}$> 9 characters

An id that uniquely identifies the account.

id
required
string <uuid>

The resource identifier string

line_id
required
integer

The resource identifier string

query Parameters
apply_discounts
boolean
Default: false

Calculate available discounts and apply them to the order.

Requires additional scope for accessing the DealEngine, one of

  • admin:discounts
  • write:discounts
  • write:discounts:/available_for_receipt

The tax_lines will be updated if apply_discount results in new net_amount.

  • net_amount = gross_amount - Σ discount_lines.amount

tax_line.amount will be calculated from tax_line.percentage and net_amount.

Request Body schema: application/json

draft line item resource

gross_amount
required
integer >= 0

Monetary amount in smallest unit for the currency before discounts

tax_lines
required
Array of object (TaxItem) non-empty
line_id
integer

The number of the line (or id), must be unique between all items.

quantity
number
Default: 1

The quantity of the product in the item line.

id
string

The ID or SKU of the product on the line

groups
Array of object

The groups the product on the line belongs to

description
string
description_alias
string

Short description / title of the product

metadata
object

Additional details about the item, key values will be included as extra_info in the receipt.

eligible_for_discount
boolean
dimension
object (Dimension)

Identify item attributes, such as size and color

discount_lines
Array of object (DiscountItem)
additions
Array of object

Additions, customization of the item. The gross_amount for an addition should be included in the item gross_amount and included in the tax_lines if applicable.

store
object
related_item
object

Relationship with another line item.

An item with a required relationship with another line item will be removed from the order if the related line is removed

An item with optional relationship will remain in the order if the related line is removed, the related_item will be cleared as the line it relates to does not exist anymore

salesperson_id
string

Id of the sales person if other then the operator

salesperson_name
string

Name of the sales person

comment
string <= 255 characters

comment on the item

Responses

202

draft order was updated

400

Bad / Invalid request

401

Access forbidden, invalid JWT token was used

403

Forbidden

404

Resource was not found

500

Unexpected Error

Request samples

application/json
Copy
Expand all Collapse all
{
  • "id": "175938",
  • "metadata": { },
  • "groups":
    [
    ],
  • "line_id": 1,
  • "quantity": 2,
  • "gross_amount": 39800,
  • "tax_lines":
    [
    ],
  • "description": "Stablestol for utendørsbruk",
  • "description_alias": "Staplestol",
  • "eligible_for_discount": true,
  • "dimension":
    {
    },
  • "discount_lines":
    [
    ],
  • "additions":
    [
    ],
  • "store":
    {
    },
  • "related_item":
    {
    },
  • "salesperson_id": "string",
  • "salesperson_name": "string",
  • "comment": "string"
}

Response samples

application/json
Copy
Expand all Collapse all
{
  • "id": "bd04c959-d159-49b4-a096-2d84e014a8da",
  • "created_at": "2019-06-21T14:38:21Z",
  • "created_by": "bd04c959-d159-49b4-a096-2d84e014a8da",
  • "updated_at": "2019-06-21T14:38:21Z",
  • "deleted_by": "bd04c959-d159-49b4-a096-2d84e014a8da",
  • "deleted_at": "2019-06-21T14:38:21Z",
  • "status": "open",
  • "_links":
    [
    ],
  • "options":
    {
    },
  • "order":
    {
    }
}

Order

Orders collection

get /accounts/{aid}/shopping/orders
https://api.dintero.com/v1/accounts/{aid}/shopping/orders
https://test.dintero.com/v1/accounts/{aid}/shopping/orders

Retrieve a list of orders

scopes:

  • admin:shopping
  • read:shopping
path Parameters
aid
required
string <^[PT]{1}\d{8}$> 9 characters

An id that uniquely identifies the account.

query Parameters
starting_after
string <uuid>

cursor for use in pagination. starting_after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include starting_after=obj_foo in order to fetch the next page of the list.

limit
integer [ 1 .. 100 ]
Default: 10

A limit on the number of objects to be returned. Limit can range between 1 and 100 items, and the default is 10 items.

status
string
Enum:"open" "closed" "cancelled"

filter by order status

payment_status
string
Enum:"pending" "partially_paid" "paid" "partially_refunded" "refunded"

filter by payment status

created_at.gte
string <date>

filter by created_at, greater than or equal (after)

created_at.lte
string <date>

filter by created_at, less than or equal (before)

include_events
boolean
Default: false

include order events in response

Responses

200

order collection

Response Schema: application/json
orders
required
Array of object (Order)
400

Bad / Invalid request

401

Access forbidden, invalid JWT token was used

403

Forbidden

500

Unexpected Error

Response samples

application/json
Copy
Expand all Collapse all
{
  • "orders":
    [
    ]
}

Get Order

get /accounts/{aid}/shopping/orders/{order_id}
https://api.dintero.com/v1/accounts/{aid}/shopping/orders/{order_id}
https://test.dintero.com/v1/accounts/{aid}/shopping/orders/{order_id}

Retrieve Order details

scopes:

  • admin:shopping
  • read:shopping
path Parameters
aid
required
string <^[PT]{1}\d{8}$> 9 characters

An id that uniquely identifies the account.

order_id
required
string <uuid>

The resource identifier string

query Parameters
include_events
boolean
Default: false

include order events in response

Responses

200

order

Response Schema: application/json
object Order Recursive
401

Access forbidden, invalid JWT token was used

403

Forbidden

404

Resource was not found

500

Unexpected Error

Response samples

application/json
Copy
Expand all Collapse all
{
  • "id": "bd04c959-d159-49b4-a096-2d84e014a8da",
  • "created_at": "2019-06-21T14:38:21Z",
  • "created_by": "bd04c959-d159-49b4-a096-2d84e014a8da",
  • "cancelled_reason": "customer",
  • "cancelled_by": "bd04c959-d159-49b4-a096-2d84e014a8da",
  • "cancelled_at": "2019-06-21T14:38:21Z",
  • "closed_by": "bd04c959-d159-49b4-a096-2d84e014a8da",
  • "closed_at": "2019-06-21T14:38:21Z",
  • "status": "open",
  • "payment_status": "pending",
  • "type": "delivery",
  • "order_number": "order123456",
  • "customer":
    {
    },
  • "currency": "NOK",
  • "gross_amount": 59800,
  • "net_amount": 47840,
  • "total_discount": 23130,
  • "total_manual_discount_amount": 0,
  • "amount_due": 0,
  • "items":
    [
    ],
  • "shipping_address":
    {
    },
  • "billing_address":
    {
    },
  • "metadata": { },
  • "comment": "string",
  • "salesperson_id": "string",
  • "salesperson_name": "string",
  • "delivery_at": "2019-06-21T14:38:21Z",
  • "pickup_at": "2019-06-21T14:38:21Z",
  • "courier_id": "string",
  • "pre_order": true,
  • "captures":
    [
    ],
  • "refunds":
    [
    ],
  • "discounts":
    [
    ],
  • "delivery_id": "string",
  • "store":
    {
    },
  • "_links":
    [
    ],
  • "state": "string",
  • "events":
    [
    ]
}

Put Order

put /accounts/{aid}/shopping/orders/{order_id}
https://api.dintero.com/v1/accounts/{aid}/shopping/orders/{order_id}
https://test.dintero.com/v1/accounts/{aid}/shopping/orders/{order_id}

Update an order

scopes:

  • admin:shopping
  • read:shopping
path Parameters
aid
required
string <^[PT]{1}\d{8}$> 9 characters

An id that uniquely identifies the account.

order_id
required
string <uuid>

The resource identifier string

Request Body schema: application/json

order update resource

shipping_address
object (ContactObject)
delivery_id
string
pickup_at
string <date-time>
courier_id
string

Responses

200

order

Response Schema: application/json
object Order Recursive
400

Bad / Invalid request

401

Access forbidden, invalid JWT token was used

403

Forbidden

404

Resource was not found

500

Unexpected Error

Request samples

application/json
Copy
Expand all Collapse all
{
  • "shipping_address":
    {
    },
  • "delivery_id": "string",
  • "pickup_at": "2019-06-21T14:38:21Z",
  • "courier_id": "string"
}

Response samples

application/json
Copy
Expand all Collapse all
{
  • "id": "bd04c959-d159-49b4-a096-2d84e014a8da",
  • "created_at": "2019-06-21T14:38:21Z",
  • "created_by": "bd04c959-d159-49b4-a096-2d84e014a8da",
  • "cancelled_reason": "customer",
  • "cancelled_by": "bd04c959-d159-49b4-a096-2d84e014a8da",
  • "cancelled_at": "2019-06-21T14:38:21Z",
  • "closed_by": "bd04c959-d159-49b4-a096-2d84e014a8da",
  • "closed_at": "2019-06-21T14:38:21Z",
  • "status": "open",
  • "payment_status": "pending",
  • "type": "delivery",
  • "order_number": "order123456",
  • "customer":
    {
    },
  • "currency": "NOK",
  • "gross_amount": 59800,
  • "net_amount": 47840,
  • "total_discount": 23130,
  • "total_manual_discount_amount": 0,
  • "amount_due": 0,
  • "items":
    [
    ],
  • "shipping_address":
    {
    },
  • "billing_address":
    {
    },
  • "metadata": { },
  • "comment": "string",
  • "salesperson_id": "string",
  • "salesperson_name": "string",
  • "delivery_at": "2019-06-21T14:38:21Z",
  • "pickup_at": "2019-06-21T14:38:21Z",
  • "courier_id": "string",
  • "pre_order": true,
  • "captures":
    [
    ],
  • "refunds":
    [
    ],
  • "discounts":
    [
    ],
  • "delivery_id": "string",
  • "store":
    {
    },
  • "_links":
    [
    ]
}

Cancel Order

post /accounts/{aid}/shopping/orders/{order_id}/cancel
https://api.dintero.com/v1/accounts/{aid}/shopping/orders/{order_id}/cancel
https://test.dintero.com/v1/accounts/{aid}/shopping/orders/{order_id}/cancel

Cancel the Order

scopes:

  • admin:shopping
  • write:shopping

A cancel event will be added to the order

path Parameters
aid
required
string <^[PT]{1}\d{8}$> 9 characters

An id that uniquely identifies the account.

order_id
required
string <uuid>

The resource identifier string

Request Body schema: application/json

order resource

cancelled_reason
any

The reason why the order was canceled.

  • customer: The customer cancelled the order
  • declined: The payment was declined
  • other: Any reson

Responses

200

order

Response Schema: application/json
object Order Recursive
400

Bad / Invalid request

401

Access forbidden, invalid JWT token was used

403

Forbidden

404

Resource was not found

500

Unexpected Error

Request samples

application/json
Copy
Expand all Collapse all
{
  • "cancelled_reason": "customer"
}

Response samples

application/json
Copy
Expand all Collapse all
{
  • "id": "bd04c959-d159-49b4-a096-2d84e014a8da",
  • "created_at": "2019-06-21T14:38:21Z",
  • "created_by": "bd04c959-d159-49b4-a096-2d84e014a8da",
  • "cancelled_reason": "customer",
  • "cancelled_by": "bd04c959-d159-49b4-a096-2d84e014a8da",
  • "cancelled_at": "2019-06-21T14:38:21Z",
  • "closed_by": "bd04c959-d159-49b4-a096-2d84e014a8da",
  • "closed_at": "2019-06-21T14:38:21Z",
  • "status": "open",
  • "payment_status": "pending",
  • "type": "delivery",
  • "order_number": "order123456",
  • "customer":
    {
    },
  • "currency": "NOK",
  • "gross_amount": 59800,
  • "net_amount": 47840,
  • "total_discount": 23130,
  • "total_manual_discount_amount": 0,
  • "amount_due": 0,
  • "items":
    [
    ],
  • "shipping_address":
    {
    },
  • "billing_address":
    {
    },
  • "metadata": { },
  • "comment": "string",
  • "salesperson_id": "string",
  • "salesperson_name": "string",
  • "delivery_at": "2019-06-21T14:38:21Z",
  • "pickup_at": "2019-06-21T14:38:21Z",
  • "courier_id": "string",
  • "pre_order": true,
  • "captures":
    [
    ],
  • "refunds":
    [
    ],
  • "discounts":
    [
    ],
  • "delivery_id": "string",
  • "store":
    {
    },
  • "_links":
    [
    ]
}

Close order

post /accounts/{aid}/shopping/orders/{order_id}/close
https://api.dintero.com/v1/accounts/{aid}/shopping/orders/{order_id}/close
https://test.dintero.com/v1/accounts/{aid}/shopping/orders/{order_id}/close

Close the order

scopes:

  • admin:shopping
  • write:shopping

A close event will be added to the order

path Parameters
aid
required
string <^[PT]{1}\d{8}$> 9 characters

An id that uniquely identifies the account.

order_id
required
string <uuid>

The resource identifier string

Responses

200

order

Response Schema: application/json
object Order Recursive
400

Bad / Invalid request

401

Access forbidden, invalid JWT token was used

403

Forbidden

404

Resource was not found

500

Unexpected Error

Response samples

application/json
Copy
Expand all Collapse all
{
  • "id": "bd04c959-d159-49b4-a096-2d84e014a8da",
  • "created_at": "2019-06-21T14:38:21Z",
  • "created_by": "bd04c959-d159-49b4-a096-2d84e014a8da",
  • "cancelled_reason": "customer",
  • "cancelled_by": "bd04c959-d159-49b4-a096-2d84e014a8da",
  • "cancelled_at": "2019-06-21T14:38:21Z",
  • "closed_by": "bd04c959-d159-49b4-a096-2d84e014a8da",
  • "closed_at": "2019-06-21T14:38:21Z",
  • "status": "open",
  • "payment_status": "pending",
  • "type": "delivery",
  • "order_number": "order123456",
  • "customer":
    {
    },
  • "currency": "NOK",
  • "gross_amount": 59800,
  • "net_amount": 47840,
  • "total_discount": 23130,
  • "total_manual_discount_amount": 0,
  • "amount_due": 0,
  • "items":
    [
    ],
  • "shipping_address":
    {
    },
  • "billing_address":
    {
    },
  • "metadata": { },
  • "comment": "string",
  • "salesperson_id": "string",
  • "salesperson_name": "string",
  • "delivery_at": "2019-06-21T14:38:21Z",
  • "pickup_at": "2019-06-21T14:38:21Z",
  • "courier_id": "string",
  • "pre_order": true,
  • "captures":
    [
    ],
  • "refunds":
    [
    ],
  • "discounts":
    [
    ],
  • "delivery_id": "string",
  • "store":
    {
    },
  • "_links":
    [
    ]
}

Open order

post /accounts/{aid}/shopping/orders/{order_id}/open
https://api.dintero.com/v1/accounts/{aid}/shopping/orders/{order_id}/open
https://test.dintero.com/v1/accounts/{aid}/shopping/orders/{order_id}/open

Re-open a closed order

scopes:

  • admin:shopping
  • write:shopping

A open event will be added to the order

path Parameters
aid
required
string <^[PT]{1}\d{8}$> 9 characters

An id that uniquely identifies the account.

order_id
required
string <uuid>

The resource identifier string

Responses

200

order

Response Schema: application/json
object Order Recursive
400

Bad / Invalid request

401

Access forbidden, invalid JWT token was used

403

Forbidden

404

Resource was not found

500

Unexpected Error

Response samples

application/json
Copy
Expand all Collapse all
{
  • "id": "bd04c959-d159-49b4-a096-2d84e014a8da",
  • "created_at": "2019-06-21T14:38:21Z",
  • "created_by": "bd04c959-d159-49b4-a096-2d84e014a8da",
  • "cancelled_reason": "customer",
  • "cancelled_by": "bd04c959-d159-49b4-a096-2d84e014a8da",
  • "cancelled_at": "2019-06-21T14:38:21Z",
  • "closed_by": "bd04c959-d159-49b4-a096-2d84e014a8da",
  • "closed_at": "2019-06-21T14:38:21Z",
  • "status": "open",
  • "payment_status": "pending",
  • "type": "delivery",
  • "order_number": "order123456",
  • "customer":
    {
    },
  • "currency": "NOK",
  • "gross_amount": 59800,
  • "net_amount": 47840,
  • "total_discount": 23130,
  • "total_manual_discount_amount": 0,
  • "amount_due": 0,
  • "items":
    [
    ],
  • "shipping_address":
    {
    },
  • "billing_address":
    {
    },
  • "metadata": { },
  • "comment": "string",
  • "salesperson_id": "string",
  • "salesperson_name": "string",
  • "delivery_at": "2019-06-21T14:38:21Z",
  • "pickup_at": "2019-06-21T14:38:21Z",
  • "courier_id": "string",
  • "pre_order": true,
  • "captures":
    [
    ],
  • "refunds":
    [
    ],
  • "discounts":
    [
    ],
  • "delivery_id": "string",
  • "store":
    {
    },
  • "_links":
    [
    ]
}

Order payment

Get Capture Collection

get /accounts/{aid}/shopping/orders/{order_id}/captures
https://api.dintero.com/v1/accounts/{aid}/shopping/orders/{order_id}/captures
https://test.dintero.com/v1/accounts/{aid}/shopping/orders/{order_id}/captures

Retrieve list of captures for an order

scopes:

  • admin:shopping
  • read:shopping
path Parameters
aid
required
string <^[PT]{1}\d{8}$> 9 characters

An id that uniquely identifies the account.

order_id
required
string <uuid>

The resource identifier string

Responses

200

capture collection

Response Schema: application/json
captures
Array of object (OrderCapture)
401

Access forbidden, invalid JWT token was used

403

Forbidden

404

Resource was not found

500

Unexpected Error

Response samples

application/json
Copy
Expand all Collapse all
{
  • "captures":
    [
    ]
}

Create a capture

post /accounts/{aid}/shopping/orders/{order_id}/captures
https://api.dintero.com/v1/accounts/{aid}/shopping/orders/{order_id}/captures
https://test.dintero.com/v1/accounts/{aid}/shopping/orders/{order_id}/captures

Create a capture for an order

scopes:

  • admin:shopping
  • write:shopping

A capture event will be added to the order

path Parameters
aid
required
string <^[PT]{1}\d{8}$> 9 characters

An id that uniquely identifies the account.

order_id
required
string <uuid>

The resource identifier string

Request Body schema: application/json

order capture

amount
required
integer >= 0

Monetary amount in smallest unit for the currency before discounts

processed_at
required
string <date-time>

The date and time when the capture was processed by payment gateway

metadata
object

Additional details about the capture

Responses

<