Deliveries are the packages that a final client has ordered, it goes through a large process from its creation until it’s delivered or returned and it’s the most important part of our process.

It stores a lot of information that is vital for the proper development of the process so now we’re going to get into all the delivery creation.

Requirements:

  • Use your API Key and know how to use it.

  • Have a storeId (This storeId is the one that comes from the response of the createStore mutation, you need to put it in the referenceId field of this mutation to relate them).


Argument Structure:

Name

Type

Required

Observations

Name

Type

Required

Observations

type

enum (string):

  • ON_DEMAND

  • SAME_DAY

  • NEXT_DAY

Yes

 ON_DEMAND : On-Demand Retail service.

referenceId

string

Yes

 You can some ID from your own system (You Order / guide number)

storeId

id

Yes

 You can use your own Store id (referenceId use it to create the store)

pickup

object

Yes

*Check details object pickup.

dropoff

object

Yes

**Check details object dropoff.

packages

object

Yes

***Check details object packages.

*Object Pickup

You could check the specific argument details to Object Location and Object Contact in the page Create a Store.

Name

Type

Name

Type

location

object

contact

object

**Object Dropoff

You could check the specific argument details to Object Location and Object Contact in the page Create a Store.

Name

Type

Name

Type

location

object

contact

object

***Object Packages

Name

Type

Name

Type

size

enum (string):

  • ENVELOPE

  • SMALL_BOX

  • MEDIUM_BOX

  • BIG_BOX

dimensions

height: Float
width: Float
length: Float
weight: Float

items

object

description

string!

quantity

PositiveInt


Request:

For the creation of a new Delivery, the Mutation createDelivery is used.

Is so important to create your stores before creating a delivery. This service requires rules for each store. The “storeId” parameter in this request it will be your referenceId. You can check it HERE: Create a store .

 

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 mutation { createDelivery( input: { type: ON_DEMAND referenceId: "YOUR ORDER/GUIDE NUMBER" storeId: "1224" pickup: { contact: { name: "IVOY Test" phone: "5567890456" email: "ivoyTest@ivoy.mx" } location: { street: "TEST" externalNumber: "126" zipCode: "02719" latitude: 19.4020954 longitude: -99.1837187 instructions: "Pickup my packages ON_DEMAND" } } dropoff: { contact: { name: "IVOY Dropoff Test" phone: "5567890123" email: "ivoyTest@ivoy.mx" } location: { street: "Carlos B Zetina" externalNumber: "138" zipCode: "11800" latitude: 19.4020954 longitude: -99.1837187 instructions: "Deliver my packages ON_DEMAND" } } packages: [ { size: SMALL_BOX dimensions: { height: 1, width: 1, length: 1, weight: 1 } items: [ { description: "Cover my packages until delivery", quantity: 1 } ] } ] } ) { id trackingNumber trackingUrl referenceId } }

Response:

The expected response should be like the shown below.

1 2 3 4 5 6 7 8 9 10 { "data": { "createDelivery": { "id": "71916", "trackingNumber": "002377328R000071916", "trackingUrl": "https://tracking.ivoy.mx/guide/002377328R000071916", "referenceId": "YOUR ORDER/GUIDE NUMBER" } } }

Details Package Type

It is not necessary to send these data in the request, they are only informative.

Regarding the unit of measurement, it is based on the International System of Units for mass (Kg) and length (m).

Package

Description. (L/length - An/width - Al/height)

Package

Description. (L/length - An/width - Al/height)

envelope

Sobre

box_small

Caja chica: 40L x 30An x 25Al

box_medium

Caja Mediana: 30L x 40An x 30Al

box_big

Caja Grande: 40L x 50An x 40An

Next steps