OSuiteStart free trial

Billing API reference

Every endpoint, its fields and what it answers. Also as Markdown and OpenAPI.

Also as Markdown and OpenAPI 3.1.

The rules

Where to call
Your OSuite’s own address: the cloud edition’s, or a desktop’s Remote access address. Calls go there directly; OfinIT is not in between.
Signing in
Authorization: Bearer <a billing token>. Make one under Your account › API tokens, choosing Bill through the Billing API, one per website. Keep it on your server: never in a browser or an app people download. A site on serverless hosting (Vercel, Netlify, AWS Lambda) calls from changing addresses: leave the token’s address list empty, and expect a note to the token’s owner about each new address.
Retries
Calls that make something need an Idempotency-Key header, 8 to 100 characters, such as your order number. Sent again with the same key within 30 days (after a timeout, say), the call answers as the first time did, with Idempotent-Replayed: true, and makes nothing twice. Later than that, check first with GET /api/v1/invoices?reference=<your order number>.
Limits
120 calls a minute for a token. Each answer carries X-RateLimit-Limit and X-RateLimit-Remaining; past the limit, 429 with Retry-After in seconds: wait that long and send again. A token may also have a largest invoice (over it, 422) and a number of invoices a day (past it, 429 with no Retry-After, as it lasts until tomorrow: do not retry). Set both above your largest real values.
Errors
Errors answer { "error": "<what is wrong, in words>", "fieldErrors": { "<field>": "<what it needs>" } } with 400 or 422 for what you sent, 401 without a working token, 403 for what the token may not do, 404 for what this token cannot see, 409 for a conflict, 429 for limits.
Test keys
A test key (tick Test key when making the token) makes invoices that stay drafts marked TEST-<id>: never posted, numbered, sent or paid, and in no GST return. Its proformas stay drafts too, and its checkouts take a test payment. As nothing is posted, a test key sends no webhooks. Instead, under Connections › Webhooks: Send a test checks your signature code, and Send a sample sends the latest real event of the kind you choose, signed, under an id starting evt_sample_ (nothing changes in OSuite), so your handler is tried on real data before you go live. Each event’s schema is in openapi.json.
Webhooks
Webhooks (Connections › Webhooks) tell your server when invoices are posted (invoice.posted), cancelled (invoice.cancelled) or given another number (invoice.renumbered, which carries previousNumber: find the sale by it and take the new number and PDF), payments received, a checkout is paid (checkout.paid) or closes unpaid (checkout.expired), and a proforma is paid and invoiced (proforma.invoiced), signed with your webhook secret. The events: invoice.posted, invoice.cancelled, invoice.renumbered, payment.received, checkout.paid, checkout.expired, proforma.invoiced; a proforma that expires or is cancelled sends none (you know its validUntil, and cancel it yourself). Each is a POST with the JSON body { id, event, occurredAt, data }: data is the invoice, payment or proforma as OSuite holds it, with OSuite’s own field names (totalAmount, customerId: { id, display }), not the API’s; a checkout event carries the checkout. Before acting, fetch the document through the API: an invoice or proforma by data.id; for payment.received, which carries the payment itself (no endpoint of its own), the invoice each of its lines pays, lines[].invoiceId.id. A call that does not get a 2xx is tried again 5 more times over about 50 minutes, with the same event id and occurredAt but a fresh X-OSuite-Timestamp, so skip one you have already handled, and judge a call’s age by X-OSuite-Timestamp, never by occurredAt. A checkout event carries id, status, website, reference, invoiceId, invoiceNumber, total, currency, paidAt and expiresAt. A checkout for a proforma sends proforma.invoiced, not checkout.paid. openapi.json gives each event’s schema: the fields of data named there are promised, others may change; amounts in data are decimals as text, such as "1416.00".

POST /api/v1/customers

Find or add a customer. Finds a customer by GSTIN, then email, then mobile number; adds one when none matches and a name is given. Answers 201 when added, 200 when found. Needs an Idempotency-Key header.

Body (JSON)
namestringNeeded when no customer matches; up to 120 characters.
emailstringMatched without regard to case.
phonestringMatched on its last 10 digits.
gstinstringThe customer’s tax number: a GSTIN in India (matched first; sets the state code), a TRN or VAT number elsewhere.
stateCodestringTwo digits, e.g. 27 for Maharashtra; sets the place of supply.
streetstringAddress, for a new customer.
citystringFor a new customer.
pincodestringFor a new customer.

Answers { customer: { id, name, email, phone, gstin, stateCode }, created }

            {
  "name": "Mehta Engineering",
  "email": "buy@mehta.in",
  "gstin": "24AABCM1234A1ZD"
}
          

GET /api/v1/customers/{id}

A customer. One customer by the id OSuite gave.

Answers { id, name, email, phone, gstin, stateCode }

POST /api/v1/invoices

Make an invoice. Makes an invoice and posts it: OSuite works out the place of supply, GST, totals and the invoice number. With post: false it stays a draft: number is in the answer but null until it is posted, and its totals already include GST, the same as once posted. If no payment gateway the business connected takes its currency from this customer, the invoice is still made, with payUrl null and a warning saying so (only a checkout is refused for this). A total you send as expectTotal is checked against OSuite’s and a difference reported in warnings; OSuite’s is the invoice’s. Refused within the token’s limits (largest invoice, invoices a day). An invoice that cannot be posted (goods not in stock, say) leaves nothing behind. Needs an Idempotency-Key header.

Body (JSON)
customer requiredobject{ id } of a customer, or the customer’s details to find or add them (as in POST /api/v1/customers).
items requiredarrayUp to 200 items: { sku } of a product in OSuite, or { description, qty, price, gstRate, hsn?, discountPct?, unit?, periodFrom?, periodTo?, details? }. price is per unit before tax (GST or VAT is added on top, worked out by OSuite), in the invoice’s currency. discountPct is a percentage off that item’s unit price, so the same percentage off the item’s line; the tax is worked out on what is left. hsn takes HSN codes for goods and SAC codes for services (998315), printed in the HSN/SAC column. A SKU fills the name, price, HSN, unit and GST, which you may still give. unit is a word such as year, month, day, hour, session, visit, trip, km, user, gb or nos (or one of the business’s own units); a service with none is a lump sum. periodFrom and periodTo (YYYY-MM-DD) are the item’s own service period, printed under it. details prints under the item: any of when, vehicle, route, measure, person, staff, asset, booking, stay, and own1 to own3 for the business’s own details, such as { "vehicle": "KA01AB1234", "route": "Airport to Indiranagar" }.
referencestringYour order number; printed on the invoice.
datestringYYYY-MM-DD; today when left out.
dueDatestringYYYY-MM-DD; or dueDays.
dueDaysnumberDays after the date it is due.
placeOfSupplystringTwo-digit state code; the customer’s state when left out; 96 for a customer abroad.
currencystringISO code such as USD, EUR, GBP or AED for a customer abroad; item prices are then in it, and the customer pays in it. The business’s own currency when left out.
exchangeRatenumberHow much of the business’s currency one unit is worth on the invoice date: for goods the CBIC customs rate (CGST rule 34(1)); for services a rate by generally accepted accounting principles for that date (rule 34(2)), such as the RBI reference rate. It sets the rupee value on the GST return. Left out, in India OSuite fills FBIL’s reference rate for the invoice date (the last business day’s at weekends and holidays), as OfinIT reads it each day from RBI’s site, and the invoice notes where it came from; for goods FBIL’s stands in for CBIC’s customs rate, which OSuite has no free source for. With no rate known within a week, the rate on the business’s latest invoice in that currency is used and warnings says so. Send exchangeRate yourself to use another rate, such as your bank’s: one rate a day, from one source you also price with, never a fixed figure.
exportTypestring"lut" (export under LUT, no IGST) or "igst" (IGST paid). Needed in India when the place of supply is 96, another country.
periodFromstringFor services: YYYY-MM-DD, the first day the invoice bills; printed under the customer.
periodTostringYYYY-MM-DD, the last day it bills.
contractNostringThe contract or statement of work it bills under; printed under the customer.
siteAddressstringThe site or venue the work was done at; printed on the invoice.
jobNostringJob card or work order number; printed on the invoice.
consignmentNostringConsignment note or e-way bill number; printed on the invoice.
matterNostringMatter or case number; printed on the invoice.
instalmentsarrayTo be paid in parts: 2 to 24 of { dueDate, amount }. They add up to the total; send every amount as 0 to split the total evenly. The invoice is due on the first date, and each part is reminded on its own.
notesstringPrinted on the invoice.
postbooleanfalse keeps a draft to post later with /post.
sendarrayAny of "email", "whatsapp", "sms": sent to the customer once posted. In Saudi Arabia and Malaysia it waits until ZATCA or LHDN has accepted the invoice, then goes by itself: warnings says so.
expectTotalnumberYour total, checked against OSuite’s to the paisa: any difference adds to warnings "Your total X differs from OSuite’s Y…", and OSuite’s is the invoice’s. With paise in it, the invoice keeps its paise, as exactTotal does.
returnUrlstringhttps address the customer is offered once they have paid on payUrl, to go back to your site. For a proforma paid on its payUrl, it gets ?checkout=<id>&invoice=<id of the tax invoice> added.
exactTotalbooleantrue keeps the invoice to the paisa, with no rounding to the rupee: for what your website charged exactly.

Answers { invoice, sent, warnings }

            {
  "customer": {
    "name": "Mehta Engineering",
    "email": "buy@mehta.in",
    "stateCode": "24"
  },
  "reference": "Order 1001",
  "items": [
    {
      "sku": "LED-18",
      "qty": 4
    },
    {
      "description": "Installation",
      "hsn": "9954",
      "qty": 1,
      "price": 1000,
      "gstRate": 18
    }
  ],
  "expectTotal": 3196,
  "send": [
    "email"
  ]
}
          

GET /api/v1/invoices

This website’s invoices. The invoices this token’s website made, newest first. Invoices made in OSuite itself or by another website are not listed.

Query
customernumberOnly this customer’s.
referencestringOnly the one with this reference (your order number): check it before making an invoice again for an order whose first call got no answer.
statusstring"due" or "paid".
limitnumber1 to 100; 25 when left out.

Answers { invoices: [invoice] }

GET /api/v1/invoices/{id}

An invoice. Its status (draft, due, overdue, paid, cancelled, test), items, totals, what is paid and due, and links to view and pay it. payUrl is how a customer pays an invoice already made: OSuite’s page for it, on the business’s own gateway. A payment made there is recorded by OSuite itself, and the payment.received webhook tells you; send the customer back with returnUrl. payUrl is null when no gateway the business connected takes the invoice’s currency from this customer (making it, warnings says so): take that payment on your own gateway. Each item has its unit, periodFrom, periodTo and details. A cancelled invoice was cancelled in OSuite, perhaps reissued under a new number: see the invoice.cancelled and invoice.renumbered webhooks.

Answers { id, number, test, status, date, dueDate, reference, customer, placeOfSupply, items: [{ description, hsn, qty, price, discountPct, gstRate, taxable, unit, periodFrom, periodTo, details }], taxable, tax, total, paid, due, currency, foreign?: { currency, total, due, exchangeRate }, exportType, periodFrom, periodTo, contractNo, siteAddress, jobNo, consignmentNo, matterNo, instalments: [{ dueDate, amount }], viewUrl, payUrl, source }

DELETE /api/v1/invoices/{id}

Delete a draft. Takes back a draft this website made with post: false and will not post (a basket the customer did not pay). It had no number and is in no return. A posted invoice is refused: correct it with a credit note. Drafts left unposted for 7 days are taken back by themselves.

Answers { deleted: true }

GET /api/v1/invoices/{id}/pdf

The invoice as a PDF. The posted invoice as an A4 PDF, for your customer to download. OSuite’s invoice is the only invoice for a sale: give your customer this one, and never number or print one of your own. A test key’s invoices stay drafts and have no PDF.

Answers application/pdf

POST /api/v1/invoices/{id}/post

Post a draft. Posts an invoice made with post: false. A test key’s invoices stay drafts.

Answers invoice

POST /api/v1/invoices/{id}/send

Send an invoice. Sends a posted invoice by email, WhatsApp (through the business’s provider, with its invoice template) or SMS (its SMS provider). What could not be sent is said in warnings.

Body (JSON)
channelsarrayAny of "email", "whatsapp", "sms"; ["email"] when left out.

Answers { sent, warnings }

POST /api/v1/invoices/{id}/payments

Record a payment. A payment your website took itself (its own gateway, UPI or bank), set against the invoice as a posted receipt. Needs an Idempotency-Key header.

Body (JSON)
amountnumberWhat was received; what is due when left out. No more than is due.
modestring"upi", "bank", "card", "cash", "cheque" or "online" (a gateway or wallet); "upi" when left out. From Razorpay’s method: card → card, upi → upi, netbanking → bank, wallet → online.
referencestringThe gateway’s or bank’s reference.
datestringYYYY-MM-DD; today when left out.

Answers { paymentId, invoice }

            {
  "amount": 3196,
  "mode": "upi",
  "reference": "pay_RZP123"
}
          

POST /api/v1/invoices/{id}/credit-notes

Credit an invoice. A posted credit note against the invoice, for a refund, a return or a discount after the sale: the whole invoice when no items are sent, or only the items sent. It is in the invoice’s currency and reported in GST returns; it is set against what the invoice still owes, and any rest is left as the customer’s credit. Money you refund on your gateway is refunded there; this records it in the books. Needs an Idempotency-Key header.

Body (JSON)
reasonstring"return", "rate" (a rate difference), "discount" or "other"; "return" when left out.
itemsarrayWhat is credited, as for an invoice: [{ description, hsn, qty, price, gstRate }]. The whole invoice when left out.
datestringYYYY-MM-DD; today when left out.

Answers { creditNote: { id, number, date, reason, total, applied, left }, invoice }

            {
  "reason": "return",
  "items": [
    {
      "description": "LED panel 18W",
      "hsn": "9405",
      "qty": 1,
      "price": 450,
      "gstRate": 12
    }
  ]
}
          

POST /api/v1/proformas

Make a proforma. A bill before payment (a renewal, an advance), never a tax invoice: numbered in the PF series, in no GST return. It takes the same body as an invoice, plus validUntil (or validDays; 15 days when left out). Once the customer pays, make its tax invoice with /invoice, or let them pay on its payUrl (null, with a warning, when no connected gateway takes its currency). A proforma is not emailed when it is made: send it yourself with its viewUrl or PDF; send is kept for its tax invoice, emailed once paid. To change the price, cancel it and make a new one; both stay on record. OSuite sends no reminders for a proforma: remind the customer from your site until validUntil. Needs an Idempotency-Key header.

Body (JSON)
customer requiredobject{ id } of a customer, or the customer’s details to find or add them (as in POST /api/v1/customers).
items requiredarrayUp to 200 items: { sku } of a product in OSuite, or { description, qty, price, gstRate, hsn?, discountPct?, unit?, periodFrom?, periodTo?, details? }. price is per unit before tax (GST or VAT is added on top, worked out by OSuite), in the invoice’s currency. discountPct is a percentage off that item’s unit price, so the same percentage off the item’s line; the tax is worked out on what is left. hsn takes HSN codes for goods and SAC codes for services (998315), printed in the HSN/SAC column. A SKU fills the name, price, HSN, unit and GST, which you may still give. unit is a word such as year, month, day, hour, session, visit, trip, km, user, gb or nos (or one of the business’s own units); a service with none is a lump sum. periodFrom and periodTo (YYYY-MM-DD) are the item’s own service period, printed under it. details prints under the item: any of when, vehicle, route, measure, person, staff, asset, booking, stay, and own1 to own3 for the business’s own details, such as { "vehicle": "KA01AB1234", "route": "Airport to Indiranagar" }.
referencestringYour order number; printed on the invoice.
datestringYYYY-MM-DD; today when left out.
dueDatestringYYYY-MM-DD; or dueDays.
dueDaysnumberDays after the date it is due.
placeOfSupplystringTwo-digit state code; the customer’s state when left out; 96 for a customer abroad.
currencystringISO code such as USD, EUR, GBP or AED for a customer abroad; item prices are then in it, and the customer pays in it. The business’s own currency when left out.
exchangeRatenumberHow much of the business’s currency one unit is worth on the invoice date: for goods the CBIC customs rate (CGST rule 34(1)); for services a rate by generally accepted accounting principles for that date (rule 34(2)), such as the RBI reference rate. It sets the rupee value on the GST return. Left out, in India OSuite fills FBIL’s reference rate for the invoice date (the last business day’s at weekends and holidays), as OfinIT reads it each day from RBI’s site, and the invoice notes where it came from; for goods FBIL’s stands in for CBIC’s customs rate, which OSuite has no free source for. With no rate known within a week, the rate on the business’s latest invoice in that currency is used and warnings says so. Send exchangeRate yourself to use another rate, such as your bank’s: one rate a day, from one source you also price with, never a fixed figure.
exportTypestring"lut" (export under LUT, no IGST) or "igst" (IGST paid). Needed in India when the place of supply is 96, another country.
periodFromstringFor services: YYYY-MM-DD, the first day the invoice bills; printed under the customer.
periodTostringYYYY-MM-DD, the last day it bills.
contractNostringThe contract or statement of work it bills under; printed under the customer.
siteAddressstringThe site or venue the work was done at; printed on the invoice.
jobNostringJob card or work order number; printed on the invoice.
consignmentNostringConsignment note or e-way bill number; printed on the invoice.
matterNostringMatter or case number; printed on the invoice.
instalmentsarrayTo be paid in parts: 2 to 24 of { dueDate, amount }. They add up to the total; send every amount as 0 to split the total evenly. The invoice is due on the first date, and each part is reminded on its own.
notesstringPrinted on the invoice.
sendarrayAny of "email", "whatsapp", "sms": sent to the customer once posted. In Saudi Arabia and Malaysia it waits until ZATCA or LHDN has accepted the invoice, then goes by itself: warnings says so.
expectTotalnumberYour total, checked against OSuite’s to the paisa: any difference adds to warnings "Your total X differs from OSuite’s Y…", and OSuite’s is the invoice’s. With paise in it, the invoice keeps its paise, as exactTotal does.
returnUrlstringhttps address the customer is offered once they have paid on payUrl, to go back to your site. For a proforma paid on its payUrl, it gets ?checkout=<id>&invoice=<id of the tax invoice> added.
exactTotalbooleantrue keeps the invoice to the paisa, with no rounding to the rupee: for what your website charged exactly.
validUntilstringYYYY-MM-DD it may be paid until. After it the proforma is expired: payUrl goes and it can no longer be paid on OSuite’s page. For a renewal with a grace period, make it the last day service may be restored.
validDaysnumberOr how many days from its date.

Answers { proforma: { id, number, test, status, date, validUntil, reference, customer, items, taxable, tax, total, currency, foreign?, exportType, invoiceId, viewUrl, payUrl, source } }

            {
  "customer": {
    "id": 812
  },
  "reference": "Renewal ozero-4471",
  "validDays": 7,
  "items": [
    {
      "description": "Hosting renewal",
      "hsn": "998315",
      "qty": 1,
      "unit": "year",
      "price": 4800,
      "gstRate": 18,
      "periodFrom": "2026-12-01",
      "periodTo": "2027-11-30",
      "details": {
        "own1": "shop.example.in"
      }
    }
  ]
}
          

GET /api/v1/proformas/{id}

A proforma. Its status: open (may be paid), expired (past validUntil), invoiced (paid; invoiceId is its tax invoice), cancelled, draft or test.

Answers proforma

GET /api/v1/proformas/{id}/pdf

The proforma as a PDF. The proforma as an A4 PDF, titled Proforma Invoice. A test key’s proformas stay drafts and have no PDF.

Answers application/pdf

POST /api/v1/proformas/{id}/invoice

Invoice a paid proforma. The customer paid the proforma on your site: its tax invoice is made from it, dated today (or date), at the proforma’s exchange rate, posted, with the payment you send recorded against it, and sent as asked. It works after validUntil too, as the money is already taken. Once only: called again, it answers with the same invoice. Its tax invoice takes the proforma’s reference (Proforma <number> when it had none), so GET /api/v1/invoices?reference= finds it. A proforma being paid on OSuite’s page at that moment is refused with 409. The token’s daily limit does not apply: the money is already taken. Needs an Idempotency-Key header.

Body (JSON)
paymentobject{ amount?, mode?, reference?, date? } as for POST /api/v1/invoices/{id}/payments: recorded against the new invoice.
datestringYYYY-MM-DD; today when left out.
sendarrayAny of "email", "whatsapp", "sms"; as the proforma was made when left out.

Answers { invoice, proforma, warnings }

            {
  "payment": {
    "mode": "upi",
    "reference": "pay_RZP987"
  },
  "send": [
    "email"
  ]
}
          

POST /api/v1/proformas/{id}/cancel

Cancel a proforma. A proforma not paid (a renewal that lapsed, a price that changed) is cancelled and stays on record. A paid one is refused: correct its invoice with a credit note.

Answers proforma

POST /api/v1/usage

Send usage. A reading for a subscription’s metered line (storage, users, servers, calls): billed on its next recurring invoice, above what the line includes, at its rate. Name the subscription by the id you gave it in OSuite (Subscription id on the recurring invoice). Readings are added up; each is billed once. Needs an Idempotency-Key header.

Body (JSON)
subscription requiredstringYour id for the subscription, as on the recurring invoice.
meter requiredstringThe meter, as on the line: such as storage_gb or users.
quantity requirednumberHow much was used, 0 or more.
datestringYYYY-MM-DD the reading is for; the next invoice’s day when left out.
unitstringThe unit of the quantity, such as GB, Hours or Users: refused when the line bills in another unit. Left out, the line’s own.

Answers { reading: { id, recurring, meter, quantity, forDate, billed } }

            {
  "subscription": "acme-hosting-01",
  "meter": "storage_gb",
  "quantity": 1250.5,
  "unit": "GB"
}
          

POST /api/v1/checkout

Start a hosted checkout. A cart in, the address of OSuite’s pay page back. The cart is a draft invoice, its totals with GST but no number and in no return, until the customer pays on the business’s own gateway; then it is posted, the payment recorded, the invoice sent, and the customer taken to successUrl with ?checkout=<id>&invoice=<id>. A cart left unpaid for a day closes (status expired, webhook checkout.expired); its draft is kept a week, so a payment the bank confirms late is still billed (webhook checkout.paid), then taken back. Needs an Idempotency-Key header.

Body (JSON)
customer requiredobjectAs for an invoice.
items requiredarrayUp to 200 items: { sku } of a product in OSuite, or { description, qty, price, gstRate, hsn?, discountPct?, unit?, periodFrom?, periodTo?, details? }. price is per unit before tax (GST or VAT is added on top, worked out by OSuite), in the invoice’s currency. discountPct is a percentage off that item’s unit price, so the same percentage off the item’s line; the tax is worked out on what is left. hsn takes HSN codes for goods and SAC codes for services (998315), printed in the HSN/SAC column. A SKU fills the name, price, HSN, unit and GST, which you may still give. unit is a word such as year, month, day, hour, session, visit, trip, km, user, gb or nos (or one of the business’s own units); a service with none is a lump sum. periodFrom and periodTo (YYYY-MM-DD) are the item’s own service period, printed under it. details prints under the item: any of when, vehicle, route, measure, person, staff, asset, booking, stay, and own1 to own3 for the business’s own details, such as { "vehicle": "KA01AB1234", "route": "Airport to Indiranagar" }.
currencystringISO code such as USD, EUR, GBP or AED for a customer abroad; item prices are then in it, and the customer pays in it. The business’s own currency when left out.
exchangeRatenumberHow much of the business’s currency one unit is worth on the invoice date: for goods the CBIC customs rate (CGST rule 34(1)); for services a rate by generally accepted accounting principles for that date (rule 34(2)), such as the RBI reference rate. It sets the rupee value on the GST return. Left out, in India OSuite fills FBIL’s reference rate for the invoice date (the last business day’s at weekends and holidays), as OfinIT reads it each day from RBI’s site, and the invoice notes where it came from; for goods FBIL’s stands in for CBIC’s customs rate, which OSuite has no free source for. With no rate known within a week, the rate on the business’s latest invoice in that currency is used and warnings says so. Send exchangeRate yourself to use another rate, such as your bank’s: one rate a day, from one source you also price with, never a fixed figure.
exportTypestring"lut" (export under LUT, no IGST) or "igst" (IGST paid). Needed in India when the place of supply is 96, another country.
successUrl requiredstringhttps address the customer goes to once paid, with ?checkout=<id>&invoice=<id> added. Check GET /api/v1/checkout/{id} before you act on it.
cancelUrlstringhttps address for Back to the shop.
referencestringYour order number.
sendarrayHow the invoice is sent once paid; ["email"] when left out.

Answers { checkout: { id, status, url, expiresAt, invoice }, warnings }

            {
  "customer": {
    "name": "Anita Shah",
    "email": "anita@example.in",
    "stateCode": "27"
  },
  "reference": "Order 2041",
  "items": [
    {
      "description": "LED panel 18W",
      "hsn": "9405",
      "qty": 2,
      "price": 450,
      "gstRate": 12
    }
  ],
  "successUrl": "https://patilstore.in/thanks",
  "cancelUrl": "https://patilstore.in/cart"
}
          

GET /api/v1/checkout/{id}

A checkout. Whether it is open, paid or expired, with its invoice. Check this on your success page before you ship.

Answers { id, status, url, expiresAt, invoice }

The order inbox feed

  • GET <your feed address>?after=<the next value you last answered>, with Authorization: Bearer <the feed secret OSuite gave>.
  • 200 with JSON { "orders": [order], "next": "<where to continue>" } and the header X-OSuite-Signature: sha256=<hex HMAC-SHA256 of the exact body, keyed with the feed secret>. At most 200 orders an answer, and 2 MB.
  • As the body of POST /api/v1/invoices, with "id" (your order id, unique) and, for an order already paid, "paid": { amount, mode, reference }. "test": true makes that one order a TEST draft even on a live feed, for a sample. "liveOnly": true holds a real sale while the feed is in test mode, and bills it once the feed goes live.
  • POST <your callback address> with JSON { orderId, status: "billed" | "failed", reissuedFrom?, invoice?: { id, number, status, date, total, due, viewUrl, payUrl, pdf }, error?, warnings? }, where pdf is the posted invoice as base64, and reissuedFrom is the number the sale’s invoice had before: when OSuite reissues an invoice or gives it back its original number, the order is told again, and you replace that number and PDF with these. It comes with headers X-OSuite-Timestamp and X-OSuite-Signature: sha256=<hex HMAC-SHA256 of "<timestamp>.<body>">. Answer 2xx; OSuite tells you again until you do.

See Order inbox for an example.