JSR Tax Advisors logoAPI
Developer APIsReference documentation

Create a purchase invoice


Creates a self-billed purchase invoice conforming to UBL 2.1 with PINT OM Self-Billing customization.

Path parameters

ParameterTypeRequiredDescription
customer_profile_idstring
Required
The business profile ID of the customer issuing the invoice. Must exist in your organization.
Required data

  • Supplier party details (taxable supplier)

  • Buyer party details (invoice issuer)

  • Buyer business profile identifier

  • Line items

  • VAT information

System behavior

  • VAT rules are applied according to OMN VAT law

  • Invoice status and transmission events are tracked

Request

POST /api/purchase-invoices/{customer_profile_id}
Authorization: Bearer {jwt_token}
Response

Status code: 201 Created

Response body:

Same response structure as sales invoices, with invoice_type_code set to "389". Returns the created purchase invoice object with all calculated fields populated.

Each line includes calculated fields: base_amount, net_amount, total_amount, tax_amount. The price object in the response contains price_amount (instead of base_amount in the request).

System-generated response fields include seller_uuid and qr_code_base64. See Invoice QR Code and Seller UUID for generation rules.

See the right panel for minimal and charged purchase invoice JSON examples.

Error responses

400 Bad Request

Invalid request parameters or validation failed.

{
  "errors": {
    "message": "Business profile not found with id: {customer_profile_id}"
  }
}

For validation errors, the response includes field-specific errors:

{
  "errors": {
    "transaction_type": "Transaction type is mandatory",
    "issue_date": "Issue date is mandatory"
  }
}
401 Unauthorized

Authentication required or invalid token.

{
  "errors": {
    "message": "Authentication required or invalid token"
  }
}
500 Internal Server Error

An error occurred while processing the request.

{
  "errors": {
    "message": "An error occurred"
  }
}
API Docs