Salla Docs
Merchant API
  • Merchant API
  • Salla OAuth 2.0
Partner APIs
  • App API
  • Shipment API
Storefront
  • Twilight Engine
  • Twilight SDK
  • Web Components
  • Change Log
Salla CLI
Merchant API
  • Merchant API
  • Salla OAuth 2.0
Partner APIs
  • App API
  • Shipment API
Storefront
  • Twilight Engine
  • Twilight SDK
  • Web Components
  • Change Log
Salla CLI
Salla - Opensource
Salla - Developers Community
  1. Order Invoice
  • Welcome 👋
  • Get Started
  • Create Your First App
  • Authorization
  • Webhooks
  • Conditional Webhooks
  • Security Considerations
  • Multi-Language Support
  • Responses
  • Pagination
  • Rate Limiting
  • Versioning
  • Change Log
  • Support
  • APIs
    • Orders
      • Create Order
      • List Orders
      • Order Details
      • Create Drafted Order
      • Update Order
      • Duplicate Order
      • Order Actions
    • Order Status
      • Update Order Status
      • Create Custom Order Status
      • List Order Statuses
      • Order Status Details
      • Update Custom Order Status
      • Update Bulk Orders Statuses
      • Sort Orders Statuses
    • Order Histories
      • List Order Histories
      • Create Order History
    • Order Tags
      • Create Order Tag
      • List Order Tags
      • Delete Order Tag
    • Order Invoice
      • Create Invoice
        POST
      • List Invoices
        GET
      • Invoice Details
        GET
      • Send Order Invoice
        POST
      • Create Order Invoice
        POST
    • Order Reservations
      • List Order Reservations
    • Order Items
      • List Order Items
      • Create Order Item
      • Update Order Item
      • Delete Order Item
    • Products
      • Create Product
      • List Products
      • Product Details
      • Update Product
      • Delete Product
      • Change Product Status
      • Product Details By SKU
      • Update Product By SKU
      • Delete Product By SKU
      • Update Product Price By SKU
      • Update Bulk Product Prices
      • Import Products
      • Bulk Product Actions
    • Product Options
      • Create Product Option
      • Product Option Details
      • Update Product Option
      • Delete Product Option
    • Product Quantity
      • List Product Quantities
      • Update Bulk Quantities
      • List Quantity Change Reasons
      • List Quantity Audit
      • Update Bulk Quantities by SKU
      • Update Quantity
      • Update Quantity By SKU
    • Product Variants
      • List Product Variants
      • Product Variant Details
      • Update Product Variant
      • Update Product Variant Quantity
    • Product Tags
      • Create Product Tag
      • List Product Tags
    • Product Images
      • Attach Image by SKU
      • Attach Video by SKU
      • Attach Youtube Video
      • Attach Image
      • Update Image
      • Delete Image
    • Product Option Values
      • Create Product Option Value
      • Product Option Value Details
      • Update Product Option Value
      • Delete Product Option Value
    • Abandoned Carts
      • List Abandoned Carts
      • Abandoned Cart Details
    • Customer Groups
      • Create Customer Group
      • List Customer Groups
      • Add Customers To Group Customer
      • Update Default Customer Group
      • Update Customer Group
      • Delete Customer Group
    • Customers
      • Create Customer
      • List Customers
      • Customer Details
      • Update Customer
      • Delete Customer
      • Ban Customer
      • Un-Ban customer
      • Import Customers
    • Digitals Product
      • Attach Digital Code
      • Attach Digital File
      • Delete Digital File
    • Categories
      • Create Category
      • List Categories
      • Category Details
      • Update Category
      • Delete Category
      • Category Children
      • Categories Search
      • List Category Products
    • Exports
      • Export Orders
      • Exports Logs
      • List Export Templates
      • Create Export Template
      • Update Export Template
      • Delete Export Template
      • List Export Columns
      • Export Customers
      • Export Custom URLs
      • Export Products
    • Shipments
      • Create Shipment
      • List Shipments
      • Shipment Details
      • Shipment Tracking
      • Update Shipment Details
      • Cancel Shipment
      • Return Shipment
    • Shipping Companies
      • List Shipping Companies
      • Shipping Company Details
      • List Estimate Rates
      • Create Shipping Company
      • Update Shipping Company
      • Delete Shipping Company
      • Shipping Company Options
    • Shipping Zones
      • Create Shipping Zone
      • List Shipping Zones
      • Shipping Zone Details
      • Update Shipping Zone
      • Delete Shipping Zone
    • Shipping Rules
      • List Shipping Rules
      • Shipping Rule Details
      • Delete Shipping Rule
    • Countries
      • List Countries
      • Country Details
    • Product Option Templates
      • List Option Templates
      • Option Template Details
      • Delete Option Template
      • Update Option Template
      • Create Option Template
    • Taxes
      • Create Tax
      • List Taxes
      • Tax Details
      • Update Tax
      • Delete Tax
    • Coupons
      • Create Coupon
      • List Coupons
      • Coupon Details
      • Update Coupon
      • Delete Coupon
      • List Coupon Codes
    • Affiliates
      • List Affiliates
      • Affiliate Details
      • Create Affiliate
      • Update Affiliate
      • Delete Affiliate
    • Order Assignment
      • List Auto Assignment Rules
      • Order Assigned Employees Details
      • Update Auto Assignment Rule
      • Create Auto Assignment Rules
    • Special Offers
      • Create Special Offer
      • List Special Offers
      • Special Offer Details
      • Update Special Offer
      • Delete Special Offer
      • Change Special Offer Status
    • Transactions
      • List Transactions
      • Transaction Details
      • Update Transaction
    • Payments
      • Available Payment Methods
      • List Banks
      • Payment Bank Details
    • Settlements
      • List Instant Settlements
      • Create Instant Settlement
      • Update Instant Settlement
      • Instant Settlement Details
    • Settings
      • Settings List
      • Update Setting Slug
      • Setting Details
    • Merchant
      • User Information Details
      • Store Information
    • Brands
      • Create Brand
      • List Brands
      • Brand Details
      • Update Brand
      • Delete Brand
    • Branches
      • Create Branch
      • List Branches
      • Branch Details
      • Update Branch
      • Delete Branch
    • Currencies
      • Activate Currencies
      • List Currencies
      • List Available Currencies
    • SEO
      • List SEO Settings
      • Update SEO Settings
    • Cities
      • List Cities
    • DNS Records
      • List DNS Records
      • Create DNS Record
      • Delete DNS Record
    • Languages
      • Add Language
      • List Languages
      • Update Language
    • Employees
      • List Employees
    • Advertisements
      • Create Advertisement
      • List Advertisements
      • Advertisement Details
      • Update Advertisement
      • Delete Advertisement
    • Webhooks
      • List Active Webhooks
      • List Events
      • Register Webhook
      • Deactivate Webhook
      • Update Webhook
    • Custom URLs
      • Import Custom URLs
    • Loyalty Points
      • Customer Loyalty Points
      • Update Customer Loyalty Points
    • Reviews
      • List Reviews
      • Review Details
      • Update Review
  • Webhooks - Store Events
    • Order
    • Product
    • Customer
    • Shippings
    • Shipments
    • Brand
    • Invoice
    • Category
    • Store
    • Special Offer
    • Cart
    • Miscellaneous
  1. Order Invoice

Create Invoice

Production
https://api.salla.dev/admin/v2
Production
https://api.salla.dev/admin/v2
POST
https://api.salla.dev/admin/v2
/orders/invoices
Order Invoice
Last modified:2024-12-29 06:40:32
This endpoint allows you to create an invoice to a specific order from your side.
Note
For the order data type, you will need to specify the Invoice issuance to be from Salla.
However, for the other data types available, such as data, url, and file, you will need to set it to custom from the Store Settings.
Scopes
orders.read_write - Orders Read & Write

Request

Authorization
Add the parameter
Authorization
to Headers
,whose value is to concatenate the Token after the Bearer.
Example:
Authorization: Bearer ********************
Body Params application/json
order_id
integer 
required
Order ID. List of Order IDs can be found here
Example:
1818813486
type
enum<string> 
required
Invoice Type. Note that you cannot create a credit_note invoice type before creating a tax_invoice type
Allowed values:
tax_invoicecredit_note
Example:
tax_invoice
data_type
enum<string> 
required
Invoice Data Type.
Allowed values:
dataurlfileorder
Example:
data
url
string 
optional
URL Link to the PDF file. The variable is requiredif data_type is url.
Example:
https://i.ibb.co/jyqRQfQ/invoice.pdf
invoice_number
string  | integer 
optional
Invoice Number. The variable is requiredif data_type is data.
Example:
2sdfs435d
sub_total
number 
optional
Invoice Subtotal Cost. The variable is requiredif data_type is data.
Example:
999
total
number 
optional
Invoice Total Cost. The variable is requiredif data_type is data.
Example:
7789
shipping_cost
number 
optional
Invoice Shipping Cost. The variable is requiredif data_type is data.
Example:
78
cash_on_delivery_cost
number 
optional
Invoice COD Cost. The variable is requiredif data_type is data.
Example:
789
tax
number 
optional
Tax Cost Percentage. The variable is requiredif data_type is data.
Example:
10
tax_value
integer 
optional
Tax Value Cost. The variable is requiredif data_type is data.
Example:
35.3
Example
{
  "order_id": 1818813486,
  "type": "tax_invoice",
  "data_type": "data",
  "url": "https://i.ibb.co/jyqRQfQ/invoice.pdf",
  "invoice_number": "2sdfs435d",
  "sub_total": 999,
  "total": 7789,
  "shipping_cost": 78,
  "cash_on_delivery_cost": 789,
  "tax": 10,
  "tax_value": 35.3
}

Request samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://api.salla.dev/admin/v2/orders/invoices' \
--header 'Content-Type: application/json' \
--data-raw '{
    "order_id": 1818813486,
    "type": "tax_invoice",
    "data_type": "data",
    "url": "https://i.ibb.co/jyqRQfQ/invoice.pdf",
    "invoice_number": "2sdfs435d",
    "sub_total": 999,
    "total": 7789,
    "shipping_cost": 78,
    "cash_on_delivery_cost": 789,
    "tax": 10,
    "tax_value": 35.3
}'

Responses

🟢200Success
application/json
Body
status
number 
optional
Response status code, a numeric or alphanumeric identifier used to convey the outcome or status of a request, operation, or transaction in various systems and applications, typically indicating whether the action was successful, encountered an error, or resulted in a specific condition.
success
boolean 
optional
Response flag, boolean indicator used to signal a particular condition or state in the response of a system or application, often representing the presence or absence of certain conditions or outcomes.
data
object ( InvoiceDetails) 
optional
id
number 
required
A unique identifier of the invoice
Example:
454902145
invoice_number
string 
required
The invoice number as in the order
Example:
1
uuid
string <uuid>
required
Another unique identifier of the invoice
Example:
e7f9e1e3-90d1-487d-afe1-f97e10b80b1d
order_id
number 
required
A unique identifier assigned to the order. List of orders can be found here.
invoice_reference_id
string  | null 
required
Invoice reference. This is especially used if the invoice is issued outside Salla system
type
string 
required
Invoice Type
Example:
Tax Invoice
date
string 
required
Invoice issuance date
Example:
2023-10-01
qr_code
string  | null 
required
Invoice QR code
payment_method
string 
required
Invoice payment method
Example:
credit_card
subtotal
object 
required
shipping_cost
object 
required
cod_cost
object 
required
discount
object 
required
tax
object 
required
total
object 
required
items
array [object {10}] 
required
Invoice items details.
Examples
{
  "status": 200,
  "success": true,
  "data": {
    "id": 1333835642,
    "order_id": 1371877152,
    "type": "Tax Invoice",
    "invoice_number": "2sdfs435d",
    "sub_total": {
      "amount": 999,
      "currency": "ر.س"
    },
    "shipping_cost": {
      "amount": 78,
      "currency": "ر.س"
    },
    "cod_cost": {
      "amount": 789,
      "currency": "ر.س"
    },
    "discount": {
      "amount": 0,
      "currency": "ر.س"
    },
    "tax": {
      "percent": 10,
      "amount": {
        "amount": 35.3,
        "currency": "ر.س"
      }
    },
    "total": {
      "amount": 7789,
      "currency": "ر.س"
    },
    "date": "2022-03-23",
    "items": [
      {
        "name": "فستان فراولة",
        "quantity": 1,
        "price": {
          "amount": "90.50",
          "currency": "SAR"
        },
        "discount": {
          "amount": "0.00",
          "currency": "SAR"
        },
        "tax": {
          "percent": "15.00",
          "amount": {
            "amount": "13.58",
            "currency": "SAR"
          }
        },
        "total": {
          "amount": 104.08,
          "currency": "SAR"
        }
      }
    ]
  }
}
🟠404Not Found
🟠422Error Validation
🟠401Unauthorized
Modified at 2024-12-29 06:40:32
Previous
Order Invoice
Next
List Invoices