Saaslogic
  1. Invoices
Saaslogic
  • Introduction
  • Authentication
  • Enum Reference
  • Authentication
    • saaslogic token
      • Get the saaslogic access token
    • login Url
      • Gives the login URL
    • logout Url
      • Gives the logout URL
  • Countries
    • Get list of countries
  • Plans
    • List all plans for a product
  • Subscriptions
    • Create a product subscription
    • Retrieve a subscription
    • Create Customer and Subscription
    • Subscription with details permissions, menus and features
    • The Saaslogic URL for creating subscription
  • Usage Reporting
    • Report the resource usages in subscription for invoicing
    • Retrieves the resource usages of a subscription in the current billing cycle
  • Customers
    • addresses
      • Create an address
      • List all addresses
      • Update an address
      • Retrieve an address
      • Delete an address
    • contacts
      • Create a contact
      • List all contacts
      • Update a contact
      • Retrieve a contact
      • Delete a contact
    • Create a customer
    • List all customers
    • Update a customer
    • Retrieve a customer
    • Delete a customer
  • Vendors
    • vendor addresses
      • Create a vendor address.
      • List all vendor addresses.
      • Update a vendor address.
      • Retrieve a vendor address..
      • Delete a vendor address.
    • vendor contacts
      • Create a vendor contact.
      • List all vendor contacts.
      • Update a vendor contact.
      • Retrieve a vendor contact.
      • Delete a vendor contact.
    • vendor bills
      • Create a vendor bill
      • Cancel a vendor bill.
    • vendor bills payout
      • Update payment details to vendor bills.
    • Create a vendor
    • Update a vendor.
    • Activate a vendor.
    • Dectivate a vendor.
  • Attributes
    • Create a organization attribute and set the value
    • Retrieve a organization attribute
    • Create a user attribute
    • Update a user attribute
    • Get a user attribute
  • Invoices
    • subscriptions
      • Get the invoices
      • Get the invoices by subscription
    • payments
      • Mark the invoice payment status
    • Get the invoice details .
      GET
    • cancel the invoices
      PUT
    • Send invoice as pdf with payment link.
      POST
    • Create an on-demand invoice
      POST
  1. Invoices

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
Saaslogic authorization token
Default:
Bearer {{bearerToken}}
Content-Type
string 
optional
Default:
application/json
Accept
string 
optional
Default:
application/json
Body Params application/json
customerId
string 
required
The ID of the customer.
currencyISOCode
string 
required
The ISO currency code used for the invoice.
products
array [object {4}] 
required
The list of products included in the invoice.
productId
string 
optional
The ID of the product.
lineItems
array [object {5}] 
optional
The detailed line items for the product.
taxes
array [object {3}] 
optional
The list of taxes applied to the product.
discounts
array [object {4}] 
optional
The list of discounts applied to the product.
invoiceDate
string <yyyy-MM-ddTHH:mm:ss>
required
The date when the invoice was created.
invoiceId
string 
required
The ID of the invoice.
serviceAddressId
string 
required
The ID of the service address related to the invoice.
billingAddressId
string 
required
The ID of the billing address related to the invoice.
invoiceAttributes
array [object {2}] 
required
The list of additional attributes associated with the invoice.
attributeName
string 
optional
The name of the invoice attribute.
attributeValue
string 
optional
The value of the invoice attribute.
Examples

Responses

🟢200Invoice creation initiated successfully
application/json
Body
invoiceId
string 
required
message
string 
required
🔴500ErrorResponse
Previous
Send invoice as pdf with payment link.
Built with