Orders

Validate a draft order

POST/v2/accounts/{accountId}/orders/{orderId}/validateTry it

Validates a draft order: computes its prices and, with a live key, debits the account and sends it to production. The order must be in draft status. Test orders debit nothing.

Request

Authorization

Bearer token

Send your API key in the Authorization header: Authorization: Bearer sk_test_…. A sk_test_ key creates and sees test orders only. Keys and test mode.

Path parameters
  • accountIdstringrequired
    Unique identifier of the account
  • orderIdstringrequired
    Unique identifier of the order

Responses

200Order validated successfully
  • successboolean
  • pricesobject
  • prices.itemsarray of object
  • prices.items[].indexinteger
  • prices.items[].quantityinteger
  • prices.items[].productIdstring
  • prices.items[].unit_chargesobject
  • prices.items[].chargesobject
  • prices.items[].pricenumber
  • prices.items[].unit_pricenumber
  • prices.shippingobject
  • prices.shipping.transporterstring
  • prices.shipping.pricenumber
  • prices.totalnumber
400Bad request, invalid input

Type: Error

401Unauthorized, authentication required, or an OAuth access token unknown, expired or revoked (INVALID_TOKEN)

Type: Error

403The API key is inactive or revoked (INACTIVE_API_KEY), or targets another account (ACCOUNT_ACCESS_DENIED, refused once the account guard is enforced); with an OAuth access token: a token of scope mcp (INSUFFICIENT_SCOPE), a path naming another account or a person no longer a member of it (ACCOUNT_ACCESS_DENIED), a real token on the sandbox host (SANDBOX_REQUIRES_TEST_KEY)

Type: Error

404Order not found

Type: Error

429
500Internal server error

Type: Error

Request
curl -X POST "https://api.printags.com/v2/accounts/123e4567-e89b-12d3-a456-426614174000/orders/987e6543-e21a-11d4-a789-0242ac120002/validate" \
  -H "Authorization: Bearer $PRINTAGS_API_KEY"
Response 200
{
  "success": true,
  "prices": {
    "items": [
      {
        "index": 0,
        "quantity": 10,
        "productId": "ntag424_pvccard_white",
        "unit_charges": {
          "encoding": 0.5,
          "product": 0.5,
          "printing": 0.1,
          "packaging": 0.2,
          "recordOptions": 0.3
        },
        "charges": {
          "encoding": 5,
          "product": 5,
          "printing": 1,
          "packaging": 2,
          "recordOptions": 3
        },
        "price": 4.49,
        "unit_price": 4.49
      }
    ],
    "shipping": {
      "transporter": "default",
      "price": 5.99
    },
    "total": 50.99
  }
}