Airwallex logo

Invoices for UPI transactions

Copy for LLMView as Markdown

UPI payments require you to upload an invoice for each transaction, matched to the invoice number (order.invoice.number) you pass in when you create the Payment Intent. You can upload the invoice during the transaction or after it. If you upload it after the transaction, you must call the Update a Payment Intent APIAPI to pass the uploaded file's ID in the order.invoice.file_id field.

UPI requires an invoice to be uploaded for every transaction. Upload the invoice file with the Upload a file APIAPI to obtain a file_id, then reference that file on the Payment Intent against the invoice number. You can do this during the transaction (when you create the Payment Intent) or after the shopper has paid.

The invoice number on the uploaded invoice must be the same as the invoice number (order.invoice.number) you pass when you create the Payment Intent. If the numbers do not match, the invoice is not associated with the transaction and Airwallex may withhold settlement.

Each invoice you upload must show the following:

  • A unique invoice number
  • Your business name
  • Your business address
  • The shopper's complete address
  • A description of the goods or services
  • Units sold, such as the quantity or the time period covered
  • The amount in INR, to two decimal places, for example 2341.23 INR
  • Any taxes applied

To call the Upload a file API, your API key must have Write access to the Supporting Services > Upload Files scope. If your key is not scoped for it, the upload request fails. See API key scopes for the full scope catalog, and Manage API keys to create or update a scoped key.

Upload the invoice with the file service API

Upload the invoice as a multipart/form-data request. The response returns the file_id you pass to the Payment Intent.

Request:

Shell
1curl -X POST https://files.sandbox.airwallex.com/api/v1/files/upload \
2 -H 'Authorization: Bearer {{ACCESS_TOKEN}}' \
3 -H 'Content-Type: multipart/form-data' \
4 -d '{
5 "file": "@invoice.pdf"
6 }'

Response:

JSON
1{
2 "created": 0,
3 "file_id": "<file_id to be referenced in the payment intent>",
4 "filename": "invoice.pdf",
5 "notes": "<string>",
6 "object_type": "<string>",
7 "size": 0
8}

Upload the invoice after payment

If you upload the invoice after the shopper has paid, pass the file_id to the Update a Payment Intent APIAPI as order.invoice.file_id, against the same invoice number you used when creating the Payment Intent.

Request:

Shell
1curl -X POST https://api.sandbox.airwallex.com/api/v1/pa/payment_intents/{{PAYMENT_INTENT_ID}}/update \
2 -H 'Content-Type: application/json' \
3 -H 'Authorization: Bearer {{ACCESS_TOKEN}}' \
4 -d '{
5 "request_id": "d917ad44-6ae4-447e-a534-cce4ceebfd2e",
6 "order": {
7 "invoice": {
8 "number": "INV-123456",
9 "file_id": "{{FILE_ID}}"
10 }
11 }
12 }'
Was this page helpful?