This is a brief orientation for "how to create an order", assuming you are familiar with the API basics.
To create an order, you will need:
A Manual venue. This must be created by hand using the OrbitKit UI. You will need to know the venue key - it's in the URL and looks like "VEN123".
The variant keys of the product(s) you wish to purchase. These keys are available from the Products API. A variant key looks like "VARTS_BLK_M" (in this case, a Medium Black Basic Tee, but don't assume anything about the format of the string).
Step 1: Create (or get) Designs
What artwork do you want to print? You will need the key of one or more designs. You can use any design in your Organization's library, or you can create a design through the Designs API.
In this example, we will create a design using the Designs API. POST to the /designs endpoint:
{
"art": "http://example.com/your/image_file.png",
"filename": "image_file.png",
"batch": "2019-02-05T19:37:45.123Z",
"translations": [
{
"language": "en",
"title": "Cool Design",
"description": "It's really cool",
"tags": ["very","cool"]
},
],
"note": "My private note about this design",
"update": false
}
The design will persist in your library. If you are creating a one-off design to place an order, the translations are not critical - they won't be seen by the recipient of the order, they are just there to help you stay organized. If you intend to publish this design for sale on marketplaces, you may wish to take more care. You can also edit in the OrbitKit UI later.
When you create a design, you will receive a design key. It looks like "DES123".
Step 2: Create the Order
Create an order by posting to the /venues/VEN123/orders
endpoint. Orders must always be created in a venue, and that venue must always be a Manual venue. This is documented in the Venues API.
POST to /venues/VEN123/orders:
{
"reference": "yourprivateid",
"shipping": {
"name": "Bob Dobbs",
"address1": "123 Slack St",
"address2": "",
"city": "Nowhere",
"state": "CA",
"country": "US",
"zip": "99999"
},
"lineItems": [
{
"reference": "optionalitemref",
"design": "DES2666",
"variant": "VARTS_BLK_L",
"side": "FRONT",
"quantity": 2
}
]
}
The order reference id is optional but strongly recommended; typically this will be an identifier used in your own database. It guarantees idempotent order creation. If you accidentally create duplicate orders, we will print them and charge you for them. Please, please reach out to us if you are at all confused about idempotency - we really do love helping out fellow developers!
The line item reference is optional, but must be unique in an Order.
The variant key must come from the OrbitKit catalog.
The side must be appropriate for the specified product.
Once an order is created, you can see it in the OrbitKit UI or you can list orders in the Orders API.
As always, reach out to OrbitKit support if you have any questions.