Black Friday Bundle: Slab + MEGA + 25 cards for $74.99

Shop now →

Developers

Orders through the API

Your server can place orders through the partner API. Upload the finished artwork, save it as a design, get a quote and place the order. A live order placed this way is checked, priced, charged and printed the same way as an order placed in the portal.

Before you start

  • Make a secret key on the Developers page of the portal (API keys). Every order endpoint needs a secret key, used from your server only. Build with a test key. A test order is never charged or printed (Test mode).
  • A key acts for the person who made it. It works while that person is an owner or a manager of the account. If they leave, are removed or become a viewer, their keys are revoked. Any key of theirs that is still listed is refused with key_creator_not_permitted, reads included. An owner or a manager then needs to make a new key.
  • A live order is charged to the account’s saved card. An owner saves one on the Billing page first (Billing).

Upload the artwork

A design is the finished front and back of a card. Ask for an upload address for each file, up to 20 in one request (Ask for upload addresses):

curl -X POST -H "Authorization: Bearer sn_test_sk_…" -H "Content-Type: application/json" \
  -d '{"files":[{"side":"front","type":"png"},{"side":"back","type":"png"}]}' \
  https://partners.makesnapshots.com/api/v1/designs/upload_urls

Then send each file with PUT to its url. Use the Content-Type the answer gives, with the file as the body. Keep each upload_id. Make the files as described in Prepare print-ready files.

Save a design

Save the two uploads as a design (Save a design). We check both files automatically, with the same check and the same reasons as an upload in the portal (what the check refuses). Our team also checks every order before it prints.

  • If the check refuses a file, the answer is 422 with the code artwork_refused. Each problem is listed under problems, by side. Both uploads are removed, so upload the fixed files again.
  • The answer never includes a file. It gives only what the check read, such as the size in pixels and whether the file has its own bleed.

Designs belong to the account, whatever the key’s mode. A design saved with a test key is the same design a live order prints. List them with List designs, and archive one with Archive a design.

Quote the order

A quote prices lines without placing anything, and adds US postage (Create a quote). Choose the postage with shipping_speed: one of standard, priority, express. If you leave it out, it is standard.

Give each line a design_id, in standard or holo, and use the same shipping_speed you will order with. The quote is then what placing those lines charges. When you place the order, send the quote’s total_cents as expected_total_cents. If the total has changed since the quote, for example because the price list changed, the order is refused with price_changed instead of being charged.

Place the order

Place an order with:

  • your own reference, up to 48 characters;
  • the address it ships to, in the United States: a state, DC, a US territory or a military address;
  • a shipping_speed, if you want one other than standard;
  • up to 100 lines, each with a design, a finish and a quantity from 1 to 5,000;
  • rights_confirmed: true, which confirms for the order: “I own the copyright or have permission to use these images.”
curl -X POST -H "Authorization: Bearer sn_test_sk_…" -H "Content-Type: application/json" \
  -H "Idempotency-Key: 6f7c2e0a-order-SHOP-5521" \
  -d '{"partner_reference":"SHOP-5521","ship_to":{"name":"Ada Lovelace","street1":"12 Main St","city":"Springfield","state":"IL","zip":"62701","phone":"2175550100"},"lines":[{"design_id":"<a design id>","finish":"holo","quantity":100}],"rights_confirmed":true}' \
  https://partners.makesnapshots.com/api/v1/orders
  • An Idempotency-Key is required. One key places one order, ever. To retry, send the same key again and you get the same order back. The same key with a different body is refused. If a request was cut off part-way and you retry it with its key, it finishes the order it started instead of making a second one.
  • The order is checked and priced the same way as in the portal. The price is locked when the order is placed.
  • A live order is then charged to the saved card and goes to production.
  • If the card is declined, the order is payment_failed and the answer is still 201. We try the card again automatically, up to 4 times in all.
  • With no card saved, the order is refused with billing_required.
  • If the order would go past the daily limit, it is not placed and is refused with charge_blocked. An owner or a manager can ask for a higher limit with Request higher daily limit on the Billing page (Billing).

Follow the order

Retrieve an order answers its status, the same one the portal shows (draft, received, payment_failed, in_production, packed, shipped, delivered, cancelled), and its tracking number once it has shipped.

List orders returns the account’s orders in the key’s mode from every source, including the portal. An order someone is still writing in the portal is listed as draft. Orders come newest first, 20 at a time (up to 100 with limit). For the next page, send the answer’s next_cursor as cursor.

To be told about a change instead of asking, add a webhook.

Cancel an order

  1. An order whose payment failed closes at once.
  2. A paid order that has not gone to production is refunded in full, then closed.
  3. While a charge or a refund is running, wait for it to finish.
  4. A charged order normally goes to production straight away. After that, the API cannot cancel it. Email support@makesnapshots.com with the order number instead.

Every order answer has a cancellable field. It is true when Cancel an order would cancel the order now.