Get Invoice API

This API is used to retrieve invoice details. You can fetch invoice details either using:

Using Invoice ID

HTTP Method: GET

Path: _{base_url}/_api/sub/v1/merchant/invoices/{invoiceId}

Environment

Request parameters

ParameterDescription
merchantId
mandatory
Merchant key received during onboarding.
Example: YQeVda

Sample request

https://subscriptiontest.citruspay.com/api/sub/v1/merchant/invoices/5c9902082fc4f831c8b4ac71

Sample response body

{
  "invoiceId": "5c9902082fc4f831c8b4ac70",
  "subscriptionId": "5c988769652d405ed9834f67",
  "planId": "ZION155350000928619",
  "planName": "AMEXSI_155350000928610",
  "status": "Due",
  "amount": {
    "value": 1,
    "currency": "INR"
  },
  "createdOn": "2019-03-25T16:30:00.069Z",
  "modifiedOn": "2019-03-25T16:30:00.069Z",
  "retryLeft": 3,
  "authRefId": "737534002",
  "customParameter": {
    "udf1": "value"
  }
}

Using Subscription ID

All the invoices for a Subscription Id can be also fetched through using Subscription ID as query string.

Path: _{base_url}/_api/sub/v1/merchant/invoices/{invoiceId}

Environment

Request parameters

Header

ParameterDescription
merchantId
mandatory
Merchant key received during onboarding.
Example: YQeVda

Body

ParameterDescription
subscriptionId
mandatory
Subscription ID for which invoices needs to be fetched.
skip
mandatory
Skip is the number of subscriptions to be skip from the data-set fetched from database for given merchantId before applying the limit on it. It should be greater than or equal to zero.
limit
mandatory
Number of subscriptions to be fetch. It should be greater than zero. Max value of limit is 20

Sample request

https://subscriptiontest.citruspay.com/api/sub/v1/merchant/invoices/?subscription Id=5c988769652d405ed9834f67&skip=0&limit=15

Sample response

{
  "invoices": [
    {
      "invoiceId": "5c9902082fc4f831c8b4ac70",
      "subscriptionId": "5c988769652d405ed9834f67",
      "planId": "ZION155350000928619",
      "planName": "AMEXSI_155350000928610",
      "status": "Due",
      "amount": {
        "value": 1,
        "currency": "INR"
      },
      "createdOn": "2019-03-25T16:30:00.069Z",
      "modifiedOn": "2019-03-25T16:30:00.069Z",
      "retryLeft": 3,
      "authRefId": "737534002",
      "customParameter": {
        "udf1": "value"
      }
    },
    {
      "invoiceId": "5c9902082fc4f831c8b4ac6b",
      "subscriptionId": "5c988769652d405ed9834f67",
      "planId": "ZION155350000928619",
      "planName": "AMEXSI_155350000928610",
      "status": "Failed",
      "amount": {
        "value": 1,
        "currency": "INR"
      },
      "createdOn": "2019-03-25T16:30:00.034Z",
      "modifiedOn": "2019-03-25T18:00:00.531Z",
      "retryLeft": 2,
      "authRefId": "737534002",
      "customParameter": {
        "udf1": "value"
      }
    }
  ],
  "totalCount": 2,
  "page": 1
}