For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Log inGet Paid
DocumentationAPI ReferenceCLI
DocumentationAPI ReferenceCLI
  • Introduction
    • Overview
  • API Reference
      • GETList orders
      • POSTCreate a new order
      • GETGet order
      • PUTUpdate order
      • DELDelete order
      • GETGet order lines
      • GETList seats
      • PUTAssign or unassign seat
      • POSTBatch assign seats
LogoLogo
Log inGet Paid
API Referenceorders

Create a new order

POST
https://api.agentpaid.io/api/v2/orders/
POST
/api/v2/orders/
1import { PaidClient } from "@paid-ai/paid-node";
2
3async function main() {
4 const client = new PaidClient({
5 token: "YOUR_TOKEN_HERE",
6 });
7 await client.orders.createOrder({
8 customerId: "string",
9 });
10}
11main();
1{
2 "id": "string",
3 "customerId": "string",
4 "billingCustomerId": "string",
5 "billingContactIds": [
6 "string"
7 ],
8 "createdAt": "2024-01-15T09:30:00Z",
9 "updatedAt": "2024-01-15T09:30:00Z",
10 "endDate": "2024-01-15T09:30:00Z",
11 "name": "string",
12 "startDate": "2024-01-15T09:30:00Z",
13 "subscriptionTerms": 1,
14 "billedAmountNoTax": 1.1,
15 "billedTax": 1.1,
16 "estimatedTax": 1.1,
17 "orderAmount": 1.1,
18 "pendingBillingAmount": 1.1,
19 "totalAmount": 1.1,
20 "totalBilledAmount": 1.1,
21 "creationState": "draft",
22 "paymentTerms": "string",
23 "number": 1.1,
24 "metadata": {},
25 "showPaymentLink": true,
26 "showBankDetails": true,
27 "autoPostInvoices": true,
28 "autoSendBillingEmails": true,
29 "autoSendPaymentEmails": true,
30 "version": 1,
31 "billingFrequencyOverridden": true,
32 "purchaseOrderReference": "string",
33 "billingFrequencyOverride": {
34 "frequency": "monthly",
35 "customMonths": 1
36 }
37}
Creates a new order for the organization
Was this page helpful?
Previous

Get order

Next
Built with

Authentication

AuthorizationBearer
API Key authentication using Bearer token

Request

Body
customerIdstringRequired
billingCustomerIdstringOptional
billingContactIdslist of stringsOptional
namestringOptional
startDatedatetimeOptional
endDatedatetimeOptional
subscriptionTermsintegerOptional
creationStateenumOptional
Allowed values:
billingAnchorintegerOptional1-31

Day of month for billing anchor (1-31). Defaults to start date day if not provided.

paymentTermsstringOptional
externalIdstringOptional
metadatamap from strings to anyOptional
currencystringOptional
autoPostInvoicesbooleanOptional
autoSendBillingEmailsbooleanOptional
autoSendPaymentEmailsbooleanOptional
lineslist of objectsOptional
billingFrequencyOverrideobjectOptional
purchaseOrderReferencestring or nullOptional
Purchase order number printed on invoices generated from this order.

Response

201
idstring
customerIdstring
billingCustomerIdstring or null
billingContactIdslist of strings
createdAtdatetime
updatedAtdatetime
endDatedatetime or null
namestring
startDatedatetime
subscriptionTermsinteger or null
billedAmountNoTaxdouble
billedTaxdouble
estimatedTaxdouble
orderAmountdouble
pendingBillingAmountdouble
totalAmountdouble
totalBilledAmountdouble
creationStateenum
Allowed values:
paymentTermsstring or null
numberdouble
metadatamap from strings to any or null
showPaymentLinkboolean or null
showBankDetailsboolean or null
autoPostInvoicesboolean or null
autoSendBillingEmailsboolean or null
autoSendPaymentEmailsboolean or null
versioninteger
billingFrequencyOverriddenboolean
purchaseOrderReferencestring or null
billingFrequencyOverrideobject

Errors

400
Bad Request Error
403
Forbidden Error
500
Internal Server Error