Skip to main content

Using Propaga API to create an invoice for an order

If an invoice is required for the transaction, you simply need to include this additional information in the delivered order notification request.
curl --request PUT \
  --url https://staging-api.propaga.io/v1/transaction/{transactionId} \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: application/json' \
  --data '{
  "status": "delivery",
  "transactionAmount": 3500,
  "invoice": {
    "products": [
    {
        "quantity": 1,
        "product": {
          "description": "Product-Name",
          "productKey": "60131324",
          "sku": "ABCD123",
          "price": 1750,
          "unitKey": "LTR",
          "taxes": [
            {
              "type": "IVA",
              "rate": 0.16
            }
          ]
        }
      }
    ]
  }
}'

Keys in invoice object

The values of unitKey, productKey and the tax types are included in the catalog of the tax authority (SAT).For additional information, please refer to this link.
This call will update the order status to ‘delivered’ and create the invoice with the data provided. Once the client pays for the order, we will generate a complement for the invoice, incorporating the payment method. The files generated for the invoices are accessible through the following endpoint
curl --request GET \
  --url https://staging-api.propaga.io/v1/invoice/{transactionId}/documents \
  --header 'Authorization: <authorization>'