Testing the "Declared Stock" in the Eneba sandbox

To help with smooth operation on the Production, we have prepared a Sandbox environment to test your "Declared Stock" integration.

Find the detailed steps to enable your integration succesfully:

  1. Register reservation and provision callbacks with P_registerCallback mutation in Sandbox environment
  2. Create an auction in Sandbox environment through S_createAuction
  3. Call P_triggerCallback mutation in Sandbox environment for reservation and then for provision.
  4. Expect to receive a DECLARED_STOCK_RESERVATION or a DECLARED_STOCK_PROVISION from our side, depending on type field of P_triggerCallback
  5. Register your API callbacks in production environment using P_registerCallback mutation
  6. After last reservation and last provision are both successful in Sandbox environment, then you can call P_enableDeclaredStock mutation in production environment to enable declared stock.

1. Requirements

You need to successfully trigger the two callbacks to consider your integration as successful:

  • DECLARED_STOCK_RESERVATION
  • DECLARED_STOCK_PROVISION

The Sandbox will call your endpoint with a simulated payload. You're required to properly process the request and prepare an expected response.

Please keep in mind that you must pass the same OrderId to the Reservation and Provision callbacks. This will allow to simulate the purchase process

2. Example usage

Here we are triggering the DECLARED_STOCK_RESERVATION API callback, the sandbox will call the URL in the callback with a faked Reservation request payload.

mutation {
  P_triggerCallback(input: {
    type: DECLARED_STOCK_RESERVATION
    orderId: "347c4978-4f81-11ed-bdc3-0242ac120002"
    auction: {
      auctionId: "347c4e96-4f81-11ed-bdc3-0242ac120002"
      price: {
        amount: 1500
        currency: "EUR"
      }
      keyCount: 1
    }
  }){
    success
    message
  }
}

Result

Here we have got the response, it says that your system accepted the callback and returned the expected response without any errors.

Return type

The mutation returns the P_API_TriggerCallbackResponse type.
{
  "data": {
    "P_triggerCallback": {
      "success": true,
      "message": null
    }
  }
}

The failure scenario will have a "message" field, indicating the failure reason:

{
  "data": {
    "P_triggerCallback": {
      "success": false,
      "message": "Failed to send ReservationRequest (id:347c4978-4f81-11ed-bdc3-0242ac120002). Got HTTP exception: Bad Request"
    }
  }
}

3. Tracking your "Declared Stock" errors

You may find it useful to get the errors we have found while calling your "Declared Stock" integration. For this you can call the P_declaredStockResult query.

Copyright 2024 Eneba. All Rights Reserved. JSC “Helis play”, Gyneju St. 4-333, Vilnius, the Republic of Lithuania