curl --request POST \
--url https://api-pacb-uat.eximpe.com/pg/orders/{order_id}/documents/ \
--header 'Content-Type: multipart/form-data' \
--header 'X-API-Version: <api-key>' \
--header 'X-Client-ID: <api-key>' \
--header 'X-Client-Secret: <api-key>' \
--form identifier=INV_EDU_20241205 \
--form document_type=invoice \
--form file='@example-file'import requests
url = "https://api-pacb-uat.eximpe.com/pg/orders/{order_id}/documents/"
files = { "file": ("example-file", open("example-file", "rb")) }
payload = {
"identifier": "INV_EDU_20241205",
"document_type": "invoice"
}
headers = {
"X-Client-ID": "<api-key>",
"X-Client-Secret": "<api-key>",
"X-API-Version": "<api-key>"
}
response = requests.post(url, data=payload, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('identifier', 'INV_EDU_20241205');
form.append('document_type', 'invoice');
form.append('file', 'python_course_invoice_2024.pdf');
const options = {
method: 'POST',
headers: {
'X-Client-ID': '<api-key>',
'X-Client-Secret': '<api-key>',
'X-API-Version': '<api-key>'
}
};
options.body = form;
fetch('https://api-pacb-uat.eximpe.com/pg/orders/{order_id}/documents/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-pacb-uat.eximpe.com/pg/orders/{order_id}/documents/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"identifier\"\r\n\r\nINV_EDU_20241205\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"document_type\"\r\n\r\ninvoice\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\npython_course_invoice_2024.pdf\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Content-Type: multipart/form-data",
"X-API-Version: <api-key>",
"X-Client-ID: <api-key>",
"X-Client-Secret: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api-pacb-uat.eximpe.com/pg/orders/{order_id}/documents/"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"identifier\"\r\n\r\nINV_EDU_20241205\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"document_type\"\r\n\r\ninvoice\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\npython_course_invoice_2024.pdf\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Client-ID", "<api-key>")
req.Header.Add("X-Client-Secret", "<api-key>")
req.Header.Add("X-API-Version", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api-pacb-uat.eximpe.com/pg/orders/{order_id}/documents/")
.header("X-Client-ID", "<api-key>")
.header("X-Client-Secret", "<api-key>")
.header("X-API-Version", "<api-key>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"identifier\"\r\n\r\nINV_EDU_20241205\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"document_type\"\r\n\r\ninvoice\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\npython_course_invoice_2024.pdf\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-pacb-uat.eximpe.com/pg/orders/{order_id}/documents/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Client-ID"] = '<api-key>'
request["X-Client-Secret"] = '<api-key>'
request["X-API-Version"] = '<api-key>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"identifier\"\r\n\r\nINV_EDU_20241205\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"document_type\"\r\n\r\ninvoice\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\npython_course_invoice_2024.pdf\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Documents uploaded successfully",
"data": {
"order_id": "OD9411897512",
"reference_id": "TEST_FOB46D",
"amount": 1000,
"currency": "INR",
"mop_type": "upi",
"buyer": {
"name": "Vikash Gupta",
"email": "[email protected]",
"phone": "+919456789012",
"address": {
"line_1": "C-45, Sector 62, Institutional Area",
"line_2": "Near Metro Station",
"city": "Noida",
"state": "Uttar Pradesh",
"postal_code": "201309"
},
"pan_number": "ABCPV1234G",
"dob": "1987-03-15"
},
"product": {
"name": "Complete Python Programming Course Bundle",
"description": "Comprehensive online course with 50+ hours of content, projects, and certification",
"hs_code": "49019900",
"hs_code_description": "Printed books, brochures, leaflets and similar printed matter",
"type_of_goods": "service"
},
"invoice": {
"number": "IN1123213",
"date": "2025-06-22",
"file": "https://eximpe.com/inv-12312312.pdf"
},
"air_waybills": [
{
"number": "AWB-23343",
"file": "https://eximpe.com/awb-8F3F51D2.pdf"
}
],
"payments": [
{
"payment_id": "PR1469384681",
"mop_type": "upi",
"status": "captured",
"status_message": null,
"settlement": {
"status": "ready_for_settlement",
"message": null,
"settlement_details": null
},
"created_at": "2025-06-23T10:44:14.344135Z"
}
],
"status": "payment_successful",
"status_message": "Payment captured successfully",
"created_at": "2025-06-23T10:44:11.702363Z"
}
}{
"success": false,
"error": {
"code": "ERR_ORDER_002",
"message": "Validation error",
"details": {
"identifier": "This field is required."
}
}
}{
"success": false,
"error": {
"code": "ERR_AUTH_000",
"message": "Missing credentials",
"details": {
"authentication": "Missing credentials."
}
}
}{
"success": false,
"error": {
"code": "ERR_ORDER_001",
"message": "Order not found",
"details": {
"order_id": "Order not found"
}
}
}Upload Invoice
Upload an invoice or other document for an existing order.
curl --request POST \
--url https://api-pacb-uat.eximpe.com/pg/orders/{order_id}/documents/ \
--header 'Content-Type: multipart/form-data' \
--header 'X-API-Version: <api-key>' \
--header 'X-Client-ID: <api-key>' \
--header 'X-Client-Secret: <api-key>' \
--form identifier=INV_EDU_20241205 \
--form document_type=invoice \
--form file='@example-file'import requests
url = "https://api-pacb-uat.eximpe.com/pg/orders/{order_id}/documents/"
files = { "file": ("example-file", open("example-file", "rb")) }
payload = {
"identifier": "INV_EDU_20241205",
"document_type": "invoice"
}
headers = {
"X-Client-ID": "<api-key>",
"X-Client-Secret": "<api-key>",
"X-API-Version": "<api-key>"
}
response = requests.post(url, data=payload, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('identifier', 'INV_EDU_20241205');
form.append('document_type', 'invoice');
form.append('file', 'python_course_invoice_2024.pdf');
const options = {
method: 'POST',
headers: {
'X-Client-ID': '<api-key>',
'X-Client-Secret': '<api-key>',
'X-API-Version': '<api-key>'
}
};
options.body = form;
fetch('https://api-pacb-uat.eximpe.com/pg/orders/{order_id}/documents/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-pacb-uat.eximpe.com/pg/orders/{order_id}/documents/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"identifier\"\r\n\r\nINV_EDU_20241205\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"document_type\"\r\n\r\ninvoice\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\npython_course_invoice_2024.pdf\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Content-Type: multipart/form-data",
"X-API-Version: <api-key>",
"X-Client-ID: <api-key>",
"X-Client-Secret: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api-pacb-uat.eximpe.com/pg/orders/{order_id}/documents/"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"identifier\"\r\n\r\nINV_EDU_20241205\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"document_type\"\r\n\r\ninvoice\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\npython_course_invoice_2024.pdf\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Client-ID", "<api-key>")
req.Header.Add("X-Client-Secret", "<api-key>")
req.Header.Add("X-API-Version", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api-pacb-uat.eximpe.com/pg/orders/{order_id}/documents/")
.header("X-Client-ID", "<api-key>")
.header("X-Client-Secret", "<api-key>")
.header("X-API-Version", "<api-key>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"identifier\"\r\n\r\nINV_EDU_20241205\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"document_type\"\r\n\r\ninvoice\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\npython_course_invoice_2024.pdf\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-pacb-uat.eximpe.com/pg/orders/{order_id}/documents/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Client-ID"] = '<api-key>'
request["X-Client-Secret"] = '<api-key>'
request["X-API-Version"] = '<api-key>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"identifier\"\r\n\r\nINV_EDU_20241205\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"document_type\"\r\n\r\ninvoice\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\npython_course_invoice_2024.pdf\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Documents uploaded successfully",
"data": {
"order_id": "OD9411897512",
"reference_id": "TEST_FOB46D",
"amount": 1000,
"currency": "INR",
"mop_type": "upi",
"buyer": {
"name": "Vikash Gupta",
"email": "[email protected]",
"phone": "+919456789012",
"address": {
"line_1": "C-45, Sector 62, Institutional Area",
"line_2": "Near Metro Station",
"city": "Noida",
"state": "Uttar Pradesh",
"postal_code": "201309"
},
"pan_number": "ABCPV1234G",
"dob": "1987-03-15"
},
"product": {
"name": "Complete Python Programming Course Bundle",
"description": "Comprehensive online course with 50+ hours of content, projects, and certification",
"hs_code": "49019900",
"hs_code_description": "Printed books, brochures, leaflets and similar printed matter",
"type_of_goods": "service"
},
"invoice": {
"number": "IN1123213",
"date": "2025-06-22",
"file": "https://eximpe.com/inv-12312312.pdf"
},
"air_waybills": [
{
"number": "AWB-23343",
"file": "https://eximpe.com/awb-8F3F51D2.pdf"
}
],
"payments": [
{
"payment_id": "PR1469384681",
"mop_type": "upi",
"status": "captured",
"status_message": null,
"settlement": {
"status": "ready_for_settlement",
"message": null,
"settlement_details": null
},
"created_at": "2025-06-23T10:44:14.344135Z"
}
],
"status": "payment_successful",
"status_message": "Payment captured successfully",
"created_at": "2025-06-23T10:44:11.702363Z"
}
}{
"success": false,
"error": {
"code": "ERR_ORDER_002",
"message": "Validation error",
"details": {
"identifier": "This field is required."
}
}
}{
"success": false,
"error": {
"code": "ERR_AUTH_000",
"message": "Missing credentials",
"details": {
"authentication": "Missing credentials."
}
}
}{
"success": false,
"error": {
"code": "ERR_ORDER_001",
"message": "Order not found",
"details": {
"order_id": "Order not found"
}
}
}Overview
The Upload Invoice endpoint is used to attach required documents to an order after it has been created. This is crucial for compliance and record-keeping. The request must be sent asmultipart/form-data.
This endpoint allows you to upload a document (like an invoice or air waybill), associated with an existing order.
Request Parameters
Path
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| order_id | path | string | Yes | Unique identifier of the order |
Body (multipart/form-data)
Parameter Definitions
Top-level
| Name | Type | Required | Description | Constraints |
|---|---|---|---|---|
| identifier | string | Yes | Identifier for the document | Free-form string for your reference (e.g., invoice or AWB number) |
| document_type | string | Yes | Type of document | Enum: invoice, awb |
| file | binary | Yes | The file to upload | Max size 2MB; supported formats: pdf, jpg, jpeg |
Examples
curl -X POST 'https://api.eximpe.com/pg/orders/{order_id}/documents/' \
-H 'Accept: application/json' \
-H 'X-Client-ID: {client_id}' \
-H 'X-Client-Secret: {client_secret}' \
-F 'identifier=INV23987' \
-F 'document_type=invoice' \
-F '[email protected];type=application/pdf'
curl -X POST 'https://api.eximpe.com/pg/orders/{order_id}/documents/' \
-H 'Accept: application/json' \
-H 'X-Client-ID: {client_id}' \
-H 'X-Client-Secret: {client_secret}' \
-F 'identifier=AWB23987' \
-F 'document_type=awb' \
-F '[email protected];type=application/pdf'
Authorizations
Client Application ID - Your unique application identifier used to authenticate API requests. You can find your Client ID in the Developer Settings section of the merchant dashboard.
Client Secret Key - Your secret key used alongside the Client ID for secure authentication. Keep this confidential and never expose it in client-side code. Available in the Developer Settings section of the merchant dashboard.
API Version - Specifies which version of the API to use (e.g., '1.X.X', '2.X.X', or '3.X.X'). This header allows you to control which API version your integration uses. Default version information is available in the Developer Settings.
Path Parameters
Unique identifier of the order
Body
Document upload request. The body must be multipart/form-data.