A design session lets your own software create a design before the customer opens the builder. The API returns the design id and a link you send the customer over WhatsApp, e-mail, SMS or anywhere else. The link opens the builder on a page hosted by Build A Gang Sheet, with the sizes you chose. Use it when your customers do not order through a web storefront, for example through a chat bot or a sales desk.
Before You Start
You need an API token for your shop.
- In your merchant dashboard, click API Tokens in the side menu. This opens the Custom API page.
- Under API Tokens, click Create New Token and create the token.
- Copy the token right away and store it on your server.
Keep the token on your server. Never put it in frontend JavaScript, a chat bot's client code or a link you send to customers.
To know the moment the customer saves, set a Design Saved webhook URL first. See Set Up and Verify Custom API Webhooks.
Create the Design and Its Link
Send a POST request with your token in the Authorization header:
POST /api/v1/design HTTP/1.1
Host: app.buildagangsheet.com
Content-Type: application/json
Authorization: Bearer {API_TOKEN}
{
"sizes": [
{ "id": 1, "width": 22, "height": 12, "unit": "in", "title": "22\" x 12\"", "price": 9.50 },
{ "id": 2, "width": 22, "height": 24, "unit": "in" }
],
"size_id": 2,
"quantity": 1,
"artboard": "gang-sheet",
"customer": { "id": 9198, "name": "Priya", "email": "priya@example.com" },
"reference": "whatsapp:9198",
"metadata": { "conversation_id": "c-55" }
}
| Field | Meaning |
|---|---|
sizes | Required. The sizes the builder offers, from 1 to 50. Each needs an id (a positive whole number), a width and a height. unit is in, cm or mm and defaults to in. title and price are optional. |
size_id | Optional. The size the builder opens on. It must be the id of one of the sizes. Defaults to the first size. |
quantity | Optional. From 1 to 10,000. Defaults to 1. |
artboard | Optional. gang-sheet (the default) or sticker. |
customer | Optional. When you send it, customer.id is required and must be a positive whole number. name and email are optional. |
reference | Optional. Your own id for this design, up to 191 characters. It comes back in the status call and in every webhook for the design. |
metadata | Optional. Any JSON object. It comes back unchanged in the status call and in every webhook. |
A gang sheet size in inches can be at most 360 in tall. A taller size is refused.
The response is 201 with the link in url:
{
"success": true,
"url": "https://app.buildagangsheet.com/gs/builder/session/{DESIGN_ID}",
"design": {
"id": "{DESIGN_ID}",
"status": "draft",
"customer_finished": false,
"print_file_ready": false,
"quantity": 1,
"url": "https://app.buildagangsheet.com/gs/builder/session/{DESIGN_ID}",
"reference": "whatsapp:9198",
"metadata": { "conversation_id": "c-55" }
}
}
Keep design.id. You need it to check the status, generate the print file and match webhooks. Creating a design session never uses credits.
A validation error comes back with HTTP 200, "success": false and an errors object. Check success, not only the HTTP code.
What the Customer Sees
- The customer opens the link. The page shows your logo and shop name and an Open the builder button.
- The customer clicks Open the builder, designs the sheet with the sizes you sent and presses Save.
- The page then says Your design is saved and offers Open the design again, so the customer can make changes. Each save sends your Design Saved webhook again.
The first save moves the design from draft to created. The same link keeps working until you start generating the print file. Once the design is pending, processing or completed, the link no longer opens the builder. It tells the customer the design is being prepared for print and to contact you for a change.
Check Where a Design Is
Send a GET request to the status endpoint. It works for any design of your shop and never uses credits:
GET /api/v1/design/{DESIGN_ID}/status HTTP/1.1
Host: app.buildagangsheet.com
Authorization: Bearer {API_TOKEN}
| Field | Meaning |
|---|---|
status | draft (created by API, the customer has not saved), created (the customer saved), pending or processing (the print file is generating), completed (the print file is ready) or failed. |
customer_finished | true once the design is past draft. |
print_file_ready | true when status is completed. |
url | The customer link, for designs created by API. Otherwise null. |
reference, metadata | What you sent when you created the design. |
The status call does not return the print file. When the customer has finished, call Generate Gang Sheet (POST /api/v1/design/generate) and fetch the file with Get Gang Sheet (GET /api/v1/design/{design_id}).
Get Gang Sheet can reduce your credits. Use the status endpoint to poll.
Limits
- Requests are limited to 200 per minute. Beyond that the API returns
429. - There is no sandbox shop. Every call works on your live shop, but creating design sessions and reading the status never use credits, so you can create test sessions freely.
- The API only sees designs of the shop that owns the token. Any other design id returns
404.
If It Does Not Work
401: the token is missing or invalid.- The link shows a 404 page: the design was not created by
POST /api/v1/design. Only API-created designs have a customer link. - The customer says the link no longer opens the builder: you already started generating the print file. Contact the customer and make the change yourself, or create a new design session.