Create Invoice

API Explorer
https://api.ipospays.tech/invoice-service/v1/invoices
POST

Create invoice endpoint helps you create a new invoice. Invoices are always created in DRAFT status

Header Parameters

token*string

Authentication token generated using the API Key and Secret Key using an Merchant Account. Required for all API requests.

Idempotency-Key?string

A Unique key generated for each operation to prevent duplicate processing when retrying requests. A UUID is recommended. The key must contain 1–255 visible ASCII characters. If the same request is retried with the same key within 24 hours, the API returns the original successful response with the header Idempotent-Replayed: true instead of processing the operation again

Request Body

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com" \  -H "token: your-access-token-here" \  -H "Idempotency-Key: 8a7c2d91-4e6b-4f03-9c52-1b6d8e5a7f20" \  -H "Content-Type: application/json" \  -d '{    "customer_id": "OGS1AN68JFR6H54",    "amount": 1050,    "store_id": "05cbaac8502f",    "tpn": "",    "invoice_url": "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf"  }'

{
  "data": {
    "invoice_number": "2610267125NkqLPJLTT0",
    "customer_id": "AMLZT40Y2STSJYX",
    "amount": 1050,
    "status": "DRAFT",
    "store_id": "8b1523efdd22",
    "tpn": null,
    "invoice_url": "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf",
    "payment_link_status": "NONE",
    "transactions": [],
    "created_at": "2026-10-26T07:01:25.000Z",
    "updated_at": "2026-10-26T07:01:25.000Z"
  },
  "message": "Invoice created successfully",
  "response_code": "SUCCESS",
  "status_code": 201,
  "request_id": "UAT-20261026070125-ZFWLSV",
  "timestamp": "2026-10-26T07:01:25.707Z"
}

{
  "data": null,
  "message": "The request contains invalid input parameters.",
  "response_code": "BAD_REQUEST",
  "status_code": 400,
  "request_id": "TEST-20261022132140--GIYWY",
  "timestamp": "2026-10-22T07:51:40.696Z",
  "errors": [
    {
      "field": "invoice_url",
      "messages": [
        "invoice_url or file is required"
      ]
    }
  ]
}

{
  "data": null,
  "message": "Missing authentication token. Please include a valid API token in your request.",
  "response_code": "TOKEN_MISSING",
  "status_code": 401,
  "request_id": "TEST-20261022075139-57OO8V",
  "timestamp": "2026-10-22T07:51:39.708Z"
}

{
  "data": null,
  "message": "Customer not found",
  "response_code": "NOT_FOUND",
  "status_code": 404,
  "request_id": "TEST-20261022132141-J4QUXE",
  "timestamp": "2026-10-22T07:51:41.670Z"
}

{
  "data": null,
  "message": "Store ID is ambiguous, send tpn instead",
  "response_code": "CONFLICT",
  "status_code": 409,
  "request_id": "TEST-20261009114453-80BZYX",
  "timestamp": "2026-10-09T06:14:53.871Z"
}

{
  "data": null,
  "message": "Store ID and TPN must be from the same store.",
  "response_code": "PRECONDITION_FAILED",
  "status_code": 412,
  "request_id": "<generated per request>",
  "timestamp": "<ISO 8601 time>"
}
{
  "data": null,
  "message": "The request contains invalid input parameters.",
  "response_code": "BAD_REQUEST",
  "status_code": 413,
  "request_id": "TEST-20261022132104-L3OC2G",
  "timestamp": "2026-10-22T07:51:04.770Z",
  "errors": [
    {
      "field": "file",
      "messages": [
        "file is too large (maximum 5 MB)"
      ]
    }
  ]
}
{
  "data": null,
  "message": "Unsupported content type",
  "response_code": "BAD_REQUEST",
  "status_code": 415,
  "request_id": "<generated per request>",
  "timestamp": "<ISO 8601 time>",
  "errors": [
    {
      "field": "body",
      "messages": [
        "Content-Type must be application/json"
      ]
    }
  ]
}
{
  "data": null,
  "message": "This Idempotency-Key was already used with a different request",
  "response_code": "BAD_REQUEST",
  "status_code": 422,
  "request_id": "<generated per request>",
  "timestamp": "<ISO 8601 time>"
}

{
  "data": null,
  "message": "Too many uploads are being processed, please retry shortly",
  "response_code": "RATE_LIMITED",
  "status_code": 429,
  "request_id": "<generated per request>",
  "timestamp": "<ISO 8601 time>"
}

{
  "data": null,
  "message": "An error occurred while processing your request. Please try again later.",
  "response_code": "INTERNAL_ERROR",
  "status_code": 500,
  "request_id": "<generated per request>",
  "timestamp": "<ISO 8601 time>"
}

{
  "data": null,
  "message": "Could not allocate a unique invoice number",
  "response_code": "SERVICE_UNAVAILABLE",
  "status_code": 503,
  "request_id": "<generated per request>",
  "timestamp": "<ISO 8601 time>"
}