PayOrc
Manage Payment

Upload Invoice by URL

Share an invoice or AWB document URL against a captured PayOrc transaction — PayOrc fetches the file for the PSP and stores only the URL for portal viewing.

Upload Invoice / AWB by URL

Version: 3.0.0

Upload your invoice or shipment (AWB) document after a successful payment by providing a public URL. This is required to verify your transaction and comply with government and RBI regulations for cross-border or export payments.

PayOrc downloads the document temporarily to forward it to the PSP, does not keep a permanent copy on PayOrc servers, and stores the URL so you can open it from the merchant portal.

Prerequisite: Same as Upload Invoice (file) — use a captured transaction_id (CAPTURE / PARTIALLY_CAPTURE / SALE, status AUTHORISED, not voided). For PayU, the MID must be PACB-enabled.

When and Why to Use

Use this API when the invoice/AWB already lives on your own hosting (CDN, S3, merchant site) and you prefer to pass a URL instead of multipart upload.

  1. Invoice by URL — Share a hosted commercial invoice after capture.
  2. AWB by URL — Share a hosted airway bill / shipment document.
  3. Portal View — The stored URL is shown as the View link in transaction details.

The URL must be publicly reachable over HTTPS by PayOrc servers. HTTP and private/VPN-only links are rejected.


Endpoint

MethodURL
POSThttps://api.payorc.com/orders/v1/transaction/documents/url

Please use the test credentials for sandbox testing. Request body is JSON (not multipart).


Headers

FieldTypeRequiredDescription
merchant-keyStringYesYour merchant API key
merchant-secretStringYesYour merchant API secret
Content-TypeStringYesMust be application/json

Request Body

FieldTypeRequiredDescription
transaction_idStringYesCaptured PayOrc transaction ID
document_typeStringYesINVOICE or AWB
document_refStringYesInvoice number or AWB reference. Min 3, max 100 characters.
document_urlStringYesAbsolute HTTPS URL to the document. Max 2048 characters. HTTP is not allowed.

Validations

RuleDetail
Ownershiptransaction_id must belong to the authenticated merchant
Transaction stateType ∈ CAPTURE, PARTIALLY_CAPTURE, SALE; status AUTHORISED; not voided
document_typeOnly INVOICE or AWB
document_refRequired; 3–100 characters
document_urlRequired; HTTPS only; max 2048 characters
Downloaded file types.pdf, .doc, .docx, .jpg, .jpeg (from URL path or Content-Type)
Downloaded file sizeMaximum 2 MB
Invoice duplicateAt most one INVOICE per order
AWB duplicateSame document_ref cannot be uploaded twice as AWB for the same order
PayU PACBPayU MIDs must have PACB enabled

Code Examples

Example 1 — Invoice by URL

curl --location 'https://api.payorc.com/orders/v1/transaction/documents/url' \
--header 'merchant-key: {merchant-key}' \
--header 'merchant-secret: {merchant-secret}' \
--header 'Content-Type: application/json' \
--data '{
    "transaction_id": "1000063438",
    "document_type": "INVOICE",
    "document_ref": "INV-123456",
    "document_url": "https://merchant.example.com/invoices/INV-123456.pdf"
}'

Example 2 — AWB by URL

curl --location 'https://api.payorc.com/orders/v1/transaction/documents/url' \
--header 'merchant-key: {merchant-key}' \
--header 'merchant-secret: {merchant-secret}' \
--header 'Content-Type: application/json' \
--data '{
    "transaction_id": "1000063438",
    "document_type": "AWB",
    "document_ref": "AWB-987654",
    "document_url": "https://merchant.example.com/awb/AWB-987654.pdf"
}'

Example 3 — Node.js

const axios = require('axios');

axios({
  method: 'post',
  url: 'https://api.payorc.com/orders/v1/transaction/documents/url',
  headers: {
    'merchant-key': '{merchant-key}',
    'merchant-secret': '{merchant-secret}',
    'Content-Type': 'application/json'
  },
  data: {
    transaction_id: '1000063438',
    document_type: 'INVOICE',
    document_ref: 'INV-123456',
    document_url: 'https://merchant.example.com/invoices/INV-123456.pdf'
  }
})
  .then(response => console.log(JSON.stringify(response.data)))
  .catch(error => console.log(error.response?.data || error));

Response — Success (200)

{
    "status": "success",
    "code": "00",
    "message": "Uploaded Successfully",
    "data": {
        "m_order_id": "ORD-2024-001",
        "p_order_id": 1000063400,
        "transaction_id": "1000063438",
        "document_type": "INVOICE",
        "document_ref": "INV-123456",
        "psp": "PAYU",
        "file_name": "INV-123456.pdf",
        "document_url": "https://merchant.example.com/invoices/INV-123456.pdf"
    }
}

Response — Validation Error (400)

{
    "message": "document_url is not valid/not supplied (https only, max 2048 characters)",
    "status": "fail",
    "code": "E0044"
}

Response — Processing Error

Same response codes as Upload Invoice (file) (101–109, 201–205). Download failures typically map to 101 (format), 103 (fetch/upload failure), or 106 (size).

{
    "status": "failed",
    "code": "103",
    "message": "Failed to Upload",
    "data": null
}

Important Notes

  • Use JSON — this is not the multipart file upload endpoint.
  • PayOrc stores document_url only; the downloaded bytes are discarded after PSP upload.
  • Portal View opens the merchant URL for URL-based rows.
  • For multipart file upload, see Upload Invoice.


API Summary

AspectDetails
APITransaction Document by URL
MethodPOST
Content Typeapplication/json
Endpoint/orders/v1/transaction/documents/url
Authenticationmerchant-key + merchant-secret
Required Parameterstransaction_id, document_type, document_ref, document_url
Allowed document_typeINVOICE, AWB
Downloaded file typesPDF, DOC, DOCX, JPG, JPEG
Max download size2 MB
Eligible txn typesCAPTURE, PARTIALLY_CAPTURE, SALE
StorageURL in DB only (no permanent PayOrc file)

On this page