Download OpenAPI specification:Download
The Digipix API is RESTful API.
The HTTP response codes 200 and 201 are positive responses, all other response codes must be considered as error.
Data will only be returned for HTTP response code 200/201.
Error descriptions can be returned on 4xx or 5xx response codes.
All requests to the api must contain the access token.
The Digipix API uses authentication based on OAuth 2.0.
This is the endpoint to generate your access token, all other operations will require it.
Uses your client_id
and client_secret
to generate a new time limited access token.
Be mindful that there are different credentials for development and production environments.
The generated access token will last for one hour and can be reused within this expiration period.
When requesting the access token, you must specify the scope of your token to include all the resources you will use with it. Available scopes at this moment are "orders", "quote" and "products". You can add as many as necessary on the same request.
All other API requests must have the token in the header Authorization: Bearer <access_token>
.
Content-Type required | string Example: application/json Request Content Type |
Information to generate the access token
client_id required | string unique client id - provided by Digipix |
client_secret required | string client secret - provided by Digipix |
grant_type required | string Default: "client_credentials" permission type |
scope | Array of strings Items Enum: "orders" "quote" "products" token permissions |
{- "client_id": "abc123",
- "client_secret": "abc123",
- "grant_type": "client_credentials",
- "scope": [
- "orders",
- "quote",
- "products"
]
}
{- "access_token": "<access_token>",
- "token_type": "Bearer",
- "expires_in": 3600
}
scope: orders
Allows you to create a new order.
There are two distinct ways to create an order: pre-approved or to be approved:
Those are the possible flows:
shipmentMethodId
and without a shipmentId
. status
will be "quote" and you'll get the shipping options, with the cost
,estimatedDeliveryDays
and shipmentMethodId
of each, on the return data. shipmentMethodId
or cancel it. cost
and estimatedDeliveryDays
before approval.shipmentId
using the as its value the id
you get from a Quote endpoint return data.status
will be imediatelly "approved".cost
and estimatedDeliveryDays
before approval.status
"approved" and with a shipmentMethodId
from the table bellow.shipmentMethodId | Description |
---|---|
1 |
Cheapest |
2 |
Fastest |
3 |
Collect (only for specific contracts with Digipix) |
status
will be imediatelly "approved".cost
and estimatedDeliveryDays
before approval.orders
) Content-Type required | string Example: application/json Request Content-Type |
Authorization required | string Example: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJGZXN0Y29sb3IiLCJleHAiOjE1OTgzOTA1ODYsImp0aSI6IiIsImlhdCI6MTU5ODM4Njk4NiwiaXNzIjoiYXBpLmRpZ2lwaXguZGV2Iiwic3ViIjoiIn0.Sfp5Js009Hk5Ikq7uwnxkh-NoFX8O7S38yjP_H_X5jE Header with |
Data to create a new order
customData | object You can add your own data to this object and Digipix will not use it, just send it back to you when posting to your endpoint |
statusNotificationUrl | string The URL that digipix will send status notifications to |
required | object Contact and shipment details |
required | Array of objects Items data |
status | string If you are sending a ShipmentId you can send APPROVED here to have your order pre-approved |
shipmentId | string If you have an if from \Quote request, you can send it as a ShipmentId to create an approved order with that shipment |
shipmentMethodId | number Please refer to the 3 possible flows text above |
shipmentMethod | string Equivalent to shipmentMethodId but a label instead of an id |
shipmentKey | string Deprecated |
partnerOrderID | string <= 64 characters You can use this entry to insert your internal order/invoiceID |
{- "recipient": {
- "address": {
- "number": "32",
- "street": "Street Test",
- "complement": "N",
- "neighborhood": "Neigh",
- "stateCode": "SP",
- "city": "Sao Paulo",
- "zipCode": "09876543"
}, - "contact": {
- "firstName": "FName",
- "lastName": "LName",
- "companyName": "",
- "document": {
- "type": "cnpj",
- "value": "12123123000199"
}, - "phone": {
- "areaCode": "11",
- "number": "987654321",
- "type": "cel"
}
}
}, - "items": [
],
}
{- "id": "tFN9mEXgro9feZ7Fjf61",
- "partnerId": "eHxI1wQ5stcOsmTG5aAr",
- "partnerName": "Partner Name",
- "status": "QUOTE",
- "createdAt": "2020-08-26T21:31:10.7582058Z",
- "recipient": {
- "address": {
- "street": "Street Test",
- "number": "32",
- "complement": "N",
- "neighborhood": "Neigh",
- "city": "Sao Paulo",
- "stateCode": "SP",
- "zipCode": "09876543"
}, - "contact": {
- "firstName": "FName",
- "lastName": "LName",
- "document": {
- "type": "CNPJ",
- "value": "12123123000199"
}, - "phone": {
- "areaCode": "11",
- "number": "987654321",
- "type": "cel"
}
}
}, - "items": [
- {
- "sku": "photobook",
- "quantity": 3,
- "productPrice": 13.8,
- "total": 41.4,
}
], - "shipments": [
- {
- "id": "2DkfEcSoSs0wsOC5rueD",
- "name": "Entrega Convencional",
- "estimatedDeliveryDays": 7,
- "cost": 6.13,
- "methodId": 2,
- "total": 47.53
}, - {
- "id": "a1wGlNHXXno0iM0ipucb",
- "name": "Entrega Econômica",
- "estimatedDeliveryDays": 15,
- "cost": 2.09,
- "methodId": 1,
- "total": 43.49
}
], - "subtotal": 41.4,
- "total": 41.4
}
{- "id": "string",
- "status": "string",
- "customData": { },
- "tracking_items": [
- {
- "code": "string",
- "url": "string"
}
]
}
scope: orders
Allows you to either aapprove or cancel an order.
To approve it is necessary to inform either the shipmentId
or the shipmentMethodId
.
Only orders that are not yet in production can be canceled.
orders
) orderId required | string Order ID |
Content-Type required | string Example: application/json Request Content-Type |
Authorization required | string Header with |
Data for patching an order. Use Status and either shipmentId or shipmentMethodId.
status | string Status to patch order ("approved" or "canceled") |
shipmentId | string Selected ShipmentId from the created Order |
shipmentMethodId | number Selected ShipmentMethodId, refer to table at Create New Order |
shipmentKey | string Deprecated |
{- "status": "approved",
- "shipmentId": "ZP2ckind4FwRhfIlt5dI"
}
{- "id": "skR3yfgC9AfpDq6ixDzt",
- "partnerId": "eHxI1wQ5stcOsmTG5aAr",
- "partnerName": "Partner Name",
- "status": "APPROVED",
- "createdAt": "2020-08-26T22:02:32.970683Z",
- "recipient": {
- "address": {
- "street": "Street Test",
- "number": "32",
- "complement": "N",
- "neighborhood": "Neigh",
- "city": "Sao Paulo",
- "stateCode": "SP",
- "zipCode": "09876543"
}, - "contact": {
- "firstName": "FName",
- "lastName": "LName",
- "document": {
- "type": "CNPJ",
- "value": "12123123000199"
}, - "phone": {
- "areaCode": "11",
- "number": "987654321",
- "type": "cel"
}
}
}, - "items": [
- {
- "sku": "photobook",
- "quantity": 3,
- "productPrice": 13.8,
- "total": 41.4,
}
], - "shipment": {
- "name": "Entrega Econômica",
- "estimatedDeliveryDays": 15,
- "cost": 2.09,
- "methodId": 1
}, - "subtotal": 41.4,
- "shippingCost": 2.09,
- "total": 43.49
}
scope: orders
Retrieves an existing order
orders
) orderId required | string Order ID |
Authorization required | string Header with |
{- "id": "icTwB5S3rtfEgvE41DEo",
- "partnerId": "eHxI1wQ5stcOsmTG5aAr",
- "partnerName": "Partner Name",
- "status": "NEW",
- "createdAt": "2020-08-26T22:00:24.6153558Z",
- "recipient": {
- "address": {
- "street": "Street Test",
- "number": "32",
- "complement": "N",
- "neighborhood": "Neigh",
- "city": "Sao Paulo",
- "stateCode": "SP",
- "zipCode": "09876543"
}, - "contact": {
- "firstName": "FName",
- "lastName": "LName",
- "document": {
- "type": "CNPJ",
- "value": "12123123000199"
}, - "phone": {
- "areaCode": "11",
- "number": "987654321",
- "type": "cel"
}
}
}, - "items": [
- {
- "sku": "photobook",
- "quantity": 3,
- "productPrice": 13.8,
- "total": 41.4,
}
], - "shipment": {
- "name": "Entrega Econômica",
- "estimatedDeliveryDays": 15,
- "cost": 2.09,
- "methodId": 1
}, - "subtotal": 41.4,
- "shippingCost": 2.09,
- "total": 43.49
}
scope: products
Retrieves a list of products
products
) Authorization required | string Header with |
Content-Type required | string Request Content-Type |
[- {
- "id": "photobook",
- "name": "Photobook",
- "internalCode": 123,
- "price": 10.9,
- "weight": 400,
- "productionTime": 5,
- "parts": [
- "core"
]
}
]
scope: products
Retrieves a product by id
products
) productId required | string |
Authorization required | string Header with |
Content-Type required | string Request Content-Type |
{- "id": "photobook",
- "name": "Photobook",
- "internalCode": 123,
- "price": 10.9,
- "weight": 400,
- "productionTime": 5,
- "parts": [
- "core"
]
}
Endpoint for creating a quote.
It requires less data than an order, only an array of items
and a zipCode
, and returns the cost
and estimatedDeliveryDays
of our shipping options and a id
for each.
It does not generate an order. But you can create an order with the id
from the selected shipping.
scope: quote
This calculation is not saved, and only for consultation
quote
) Content-Type required | string Example: application/json Request Content-Type |
Authorization required | string Example: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJGZXN0Y29sb3IiLCJleHAiOjE1OTgzOTA1ODYsImp0aSI6IiIsImlhdCI6MTU5ODM4Njk4NiwiaXNzIjoiYXBpLmRpZ2lwaXguZGV2Iiwic3ViIjoiIn0.Sfp5Js009Hk5Ikq7uwnxkh-NoFX8O7S38yjP_H_X5jE Header with |
A JSON object containing info about quote
zipCode required | string 8 characters ^[0-9]{8} ZipCode (any non-numeric characters will be removed) |
required | Array of objects Array of items |
{- "zipCode": "01311100",
- "items": [
- {
- "sku": "photobook",
- "quantity": 1
}
]
}
[- {
- "zipCode": "01311100",
- "shipments": [
- {
- "id": "quote1",
- "name": "Entrega Econômica",
- "methodId": 1,
- "estimatedDeliveryDays": 8,
- "cost": 5.5
}, - {
- "id": "quote2",
- "name": "Entrega Convencional",
- "methodId": 1,
- "estimatedDeliveryDays": 5,
- "cost": 15.5
}
]
}
]
This is the POST that Digipix will do to your endpoint, if you send its URL in the statusNotificationUrl
of an order.
Although recommended, it is not necessary for you to implement this endpoint. You can also GET an order status with our order endpoint or manually consult our dashboard.
Attention: this endpoint is implemented by the partner, and not by Digipix.
The Digipix API provides functionality for notifying the status change of an order placed on the platform.
To make use of this functionality, just specify the statusNotificationUrl
field when creating an order.
statusNotificationUrl required | string |
Depending on the status extra information can be sent
id required | string non-empty |
status required | string non-empty |
object | |
Array of objects |
{- "id": "abc123",
- "status": "IN_MANUFACTURING"
}