Introduction
Endpoints
- Accounts
- Fees
- Invoices
- Meters
- Plans
- Subscriptions
- Credit grants
- Products
- Orders
- Payments
Orders
Create an order
Creates an order.
POST
/
orders
Copy
curl --request POST \
--url https://sandbox-api.billingrails.com/v1/orders \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"account_id": "<string>",
"currency": "<string>",
"use_billing_address_for_shipping": true,
"billing_address": {
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"state": "<string>",
"region": "<string>",
"postal_code": "<string>",
"country": "<string>"
},
"shipping_address": {
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"state": "<string>",
"region": "<string>",
"postal_code": "<string>",
"country": "<string>"
},
"line_items": [
{
"product_id": "<string>",
"quantity": 2,
"unit_amount": 1,
"description": "<string>"
}
],
"metadata": {}
}'
Copy
{
"order": {
"object": "order",
"id": "ord_IhMUl3rrZ3",
"created_at": "2025-02-14T17:33:40.843Z",
"number": "ORD-001",
"status": "confirmed",
"payment_status": "paid",
"fulfillment_status": "pending",
"return_status": "none",
"currency": "NGN",
"subtotal_amount": 5000,
"total_amount": 5000,
"paid_amount": 5000,
"outstanding_amount": 0,
"account_id": "acc_IhMUl3rrZ3",
"line_items": [
{
"object": "order_line_item",
"id": "oli_IhMUl3rrZ3",
"product_name": "Premium Plan",
"product_variant_name": null,
"description": "Premium subscription plan",
"quantity": 1,
"unit_amount": 5000,
"subtotal_amount": 5000,
"total_amount": 5000,
"product_id": "prod_IhMUl3rrZ3",
"product_variant_id": "pv_IhMUl3rrZ3"
}
],
"metadata": null
}
}
Authorizations
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Body
application/json
Order payload
The body is of type object
.
Response
201 - application/json
Order created
The response is of type object
.
Copy
curl --request POST \
--url https://sandbox-api.billingrails.com/v1/orders \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"account_id": "<string>",
"currency": "<string>",
"use_billing_address_for_shipping": true,
"billing_address": {
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"state": "<string>",
"region": "<string>",
"postal_code": "<string>",
"country": "<string>"
},
"shipping_address": {
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"state": "<string>",
"region": "<string>",
"postal_code": "<string>",
"country": "<string>"
},
"line_items": [
{
"product_id": "<string>",
"quantity": 2,
"unit_amount": 1,
"description": "<string>"
}
],
"metadata": {}
}'
Copy
{
"order": {
"object": "order",
"id": "ord_IhMUl3rrZ3",
"created_at": "2025-02-14T17:33:40.843Z",
"number": "ORD-001",
"status": "confirmed",
"payment_status": "paid",
"fulfillment_status": "pending",
"return_status": "none",
"currency": "NGN",
"subtotal_amount": 5000,
"total_amount": 5000,
"paid_amount": 5000,
"outstanding_amount": 0,
"account_id": "acc_IhMUl3rrZ3",
"line_items": [
{
"object": "order_line_item",
"id": "oli_IhMUl3rrZ3",
"product_name": "Premium Plan",
"product_variant_name": null,
"description": "Premium subscription plan",
"quantity": 1,
"unit_amount": 5000,
"subtotal_amount": 5000,
"total_amount": 5000,
"product_id": "prod_IhMUl3rrZ3",
"product_variant_id": "pv_IhMUl3rrZ3"
}
],
"metadata": null
}
}
Assistant
Responses are generated using AI and may contain mistakes.