Create an on-demand invoice
POST
/invoices/on-demand
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://api-sandbox.saaslogic.io/v1/invoices/on-demand' \
--header 'Authorization;' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data-raw '{
"customerId": "d90cc3a8-7cb3-11ef-a252-325096b39f47",
"currencyISOCode": "USD",
"products": [
{
"productId": "019232f7-34be-72dc-885f-2478a24303d5",
"lineItems": [
{
"description": "Premium subscription for one month",
"quantity": 1,
"unitPrice": 100,
"taxes": [
{
"description": "Sales Tax",
"taxValue": 5,
"isPercentage": true
},
{
"description": "Sales Tax",
"taxValue": 5,
"isPercentage": true
}
],
"discounts": [
{
"description": "Discount 5%",
"discountType": "coupon",
"discountValue": 5,
"isPercentage": true
},
{
"description": "Discount 5%",
"discountType": "coupon",
"discountValue": 5,
"isPercentage": true
}
]
},
{
"description": "Premium subscription for one month",
"quantity": 1,
"unitPrice": 100,
"taxes": [
{
"description": "Sales Tax",
"taxValue": 5,
"isPercentage": true
},
{
"description": "Sales Tax",
"taxValue": 5,
"isPercentage": true
}
],
"discounts": [
{
"description": "Discount 5%",
"discountType": "coupon",
"discountValue": 5,
"isPercentage": true
},
{
"description": "Discount 5%",
"discountType": "coupon",
"discountValue": 5,
"isPercentage": true
}
]
}
],
"taxes": [
{
"description": "Sales Tax",
"taxValue": 5,
"isPercentage": true
},
{
"description": "Sales Tax",
"taxValue": 5,
"isPercentage": true
}
],
"discounts": [
{
"description": "Discount 5%",
"discountType": "coupon",
"discountValue": 5,
"isPercentage": true
},
{
"description": "Discount 5%",
"discountType": "coupon",
"discountValue": 5,
"isPercentage": true
}
]
},
{
"productId": "019232f7-34be-72dc-885f-2478a24303d5",
"lineItems": [
{
"description": "Premium subscription for one month",
"quantity": 1,
"unitPrice": 100,
"taxes": [
{
"description": "Sales Tax",
"taxValue": 5,
"isPercentage": true
},
{
"description": "Sales Tax",
"taxValue": 5,
"isPercentage": true
}
],
"discounts": [
{
"description": "Discount 5%",
"discountType": "coupon",
"discountValue": 5,
"isPercentage": true
},
{
"description": "Discount 5%",
"discountType": "coupon",
"discountValue": 5,
"isPercentage": true
}
]
},
{
"description": "Premium subscription for one month",
"quantity": 1,
"unitPrice": 100,
"taxes": [
{
"description": "Sales Tax",
"taxValue": 5,
"isPercentage": true
},
{
"description": "Sales Tax",
"taxValue": 5,
"isPercentage": true
}
],
"discounts": [
{
"description": "Discount 5%",
"discountType": "coupon",
"discountValue": 5,
"isPercentage": true
},
{
"description": "Discount 5%",
"discountType": "coupon",
"discountValue": 5,
"isPercentage": true
}
]
}
],
"taxes": [
{
"description": "Sales Tax",
"taxValue": 5,
"isPercentage": true
},
{
"description": "Sales Tax",
"taxValue": 5,
"isPercentage": true
}
],
"discounts": [
{
"description": "Discount 5%",
"discountType": "coupon",
"discountValue": 5,
"isPercentage": true
},
{
"description": "Discount 5%",
"discountType": "coupon",
"discountValue": 5,
"isPercentage": true
}
]
}
],
"invoiceDate": "1970-10-17",
"invoiceId": "46845e99-f8e4-41f6-9361-c7cfd5ef7559",
"serviceAddressId": "333fb81c-63e5-4b05-a9d5-ab2a3caf814b",
"billingAddressId": "1a47de01-3b89-4f10-bf6c-603d03986004",
"invoiceAttributes": [
{
"attributeName": "shippingNumber",
"attributeValue": "SH-34556"
},
{
"attributeName": "shippingNumber",
"attributeValue": "SH-34556"
}
]
}'
Response Response Example
200 - Invoice creation initiated successfully
{
"invoiceId": "46845e99-f8e4-41f6-9361-c7cfd5ef7559",
"message": "Invoice creation initiated successfully."
}
Request
Header Params
Authorization
string
required
Default:
Bearer {{bearerToken}}
Content-Type
string
optional
Default:
application/json
Accept
string
optional
Default:
application/json
Body Params application/json