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:
- Register reservation and provision callbacks with
P_registerCallbackmutation in Sandbox environment - Create an auction in Sandbox environment through
S_createAuction - Call
P_triggerCallbackmutation in Sandbox environment for reservation and then for provision. - Expect to receive a
DECLARED_STOCK_RESERVATIONor aDECLARED_STOCK_PROVISIONfrom our side, depending ontypefield ofP_triggerCallback - Register your API callbacks in production environment using
P_registerCallbackmutation - After last reservation and last provision are both successful in Sandbox environment, then you can call
P_enableDeclaredStockmutation 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_RESERVATIONDECLARED_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 theP_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.