Skip to content

Order

1. Place Order

  • Endpoint: /v1/partners/orders
  • Description: API to generate voucher.
    • If vouchers are successfully generated, the status will be SUCCESS and the vouchers list will contain voucher data.
    • If status is PROCESSING the voucher generation is taking time and the status can be polled by the client / hubble can intimate the client using the Order reached terminal state - Webhook.
    • In case of status PROCESSING voucher list will be empty.
  • Method: POST

Request Body

{
"productId": "brand_id",
"referenceId": "idempotency key from source system",
"amount": 1000,
"denominationDetails": [
{
"denomination": 500,
"quantity": 2
}
],
"customerDetails": {
"name": "Hubble User",
"phoneNumber": "9999999999",
"email": "example@gmail.com"
}
}

Response body

{
"id": "order_id",
"referenceId" : "idempotency key from source system"
"status": "SUCCESS/FAILED/PROCESSING/REVERSED",
"vouchers": [
{
"id": "voucher_id",
"cardType" : "PIN_SECURED/CARD_NO_AND_PIN",
"cardPin": "112233",
"cardNumber": "2359481287412",
"validTill": "2022-11-22",
"amount": "500"
},
{
"id": "voucher_id",
"cardType" : "PIN_SECURED/CARD_NO_AND_PIN",
"cardPin": "112233",
"cardNumber": "2359481287412",
"validTill": "2022-11-22",
"amount": "500"
}
]
}

2. Get Order Details

  • Endpoint: /v1/partners/orders/:orderId OR / /v1/partners/orders/by-reference/:referenceId
  • Description: Get the order details based on order ID or reference ID
  • Method: GET

Response Body

{
"id": "order_id",
"referenceId" : "idempotency key from source system"
"status": "SUCCESS/FAILED/PROCESSING/REVERSED",
"vouchers": [
{
"id": "voucher_id",
"cardType" : "PIN_SECURED/CARD_NO_AND_PIN",
"cardPin": "112233",
"cardNumber": "2359481287412",
"validTill": "2022-11-22",
"amount": "100"
},
{
"id": "voucher_id",
"cardType" : "PIN_SECURED/CARD_NO_AND_PIN",
"cardPin": "112233",
"cardNumber": "2359481287412",
"validTill": "2022-11-22",
"amount": "100"
}
]
}

3. Get Voucher Details

  • Endpoint: /v1/partners/orders/vouchers/:id
  • Description: Get details of individual voucher.
  • Method: GET

Response Body

{
"id": "voucher_id",
"cardType": "PIN_SECURED/CARD_NO_AND_PIN",
"cardPin": "112233",
"cardNumber": "2359481287412",
"validTill": "2022-11-22",
"generatedDate": "2022-11-22",
"amount": "100",
"balance": "100"
}