Skip to content

Check invoice amount upon applying the rate

POST https://api.leapa.co/v2/invoices/rates

This endpoint needs your API key

Send it as a bearer token in the Authorization header. A request without one is answered with 401. See Authentication for where to find your key and how to keep it secret.

Request

curl -X POST "https://api.leapa.co/v2/invoices/rates" \
  -H "Authorization: Bearer $LEAPA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "products": [
      {
        "quantity": 1,
        "product_id": "prd_84c2e7f019",
        "rate_ids": []
      }
    ],
    "rate_id": "rat_20b6df3c9e",
    "currency": "BIF"
  }'

Response

Created

{
  "currency": "BIF",
  "amount_due": 45000,
  "rate_id": "rat_20b6df3c9e"
}

Request body

application/json

Required. Send it as JSON.

  • productsarray of ItemRequestrequired

    List of product and quantity. Constraints: Not null, Not Empty

  • rate_idstring

    Rate Id that can be used on this invoice.

  • currencystringrequired

    Currency to be used on this invoice.

    Allowed values:BIFUSDKESXAF

Response

application/json
  • currencystring

    Currency of the amount in the invoice.

    Allowed values:BIFUSDKESXAF
  • amount_dueinteger<int64>

    amount upon applying the rate to be paid for this Invoice.

  • rate_idstring

    Rate Id that can be used on this invoice.

Status codes

  • 201Created
  • 400Bad request
  • 401Unauthorized
  • 402Payment required
  • 403Forbidden
  • 404Not found
  • 428Precondition required
  • 500Server error

Request

curl -X POST "https://api.leapa.co/v2/invoices/rates" \
  -H "Authorization: Bearer $LEAPA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "products": [
      {
        "quantity": 1,
        "product_id": "prd_84c2e7f019",
        "rate_ids": []
      }
    ],
    "rate_id": "rat_20b6df3c9e",
    "currency": "BIF"
  }'

Response

Created

{
  "currency": "BIF",
  "amount_due": 45000,
  "rate_id": "rat_20b6df3c9e"
}