- Shop API-KEY -> EDGDgFU21pZD6VBpJFMX635y5Gh8vyLYiNAmh2Y5qn7Be3wPp2dNFQ9R
- Platform API-KEY -> ww7Tpkha3jxE6eJgmi74xG89zTWCSh2Pw7wVELC6t7wb6MXE8Bbsjkuj
POST /v2/alfred/purchase
{
"amount": 10,
"billingAddress": "string",
"currency": "BDT",
"customType": "string",
"description": "string",
"shippingAddress": "string",
"shopConfigurationId": "AAEAAADt1_43vWGIS1iow1I1"
}
RESPONSE:
- id
Auth as Platform POST /v2/alfred/platform/{platformId}/walletauthentication
Platform Id -> AAEAAABjvIbjm5q02jtViKul
{
"externalReferenceId": "someuser123"
}
RESPONSE:
- walletId
- accessToken
POST /v2/alfred/purchase/{purchaseId}/session
purchaseId -> AAEAAADt1_43rYRptnv83x9R
{
"countryCode": "BD",
"walletId": "AAEAAAMhEgNuYNRKX1d4T4mX"
}
RESPONSE:
- paymentSessionId
- paymentInstrumentId
POST /v2/alfred/purchase/{purchaseId}:confirm
purchaseId -> AAEAAADt1_43rYRptnv83x9R
{
"paymentSessionDetails": {
"selectedPaymentMethod": "cash",
"selectedPaymentInstrumentId": "AAEAAAQiQsrNy63ZthIylgCo"
},
"paymentSessionId": "AAEAAAkPksjmif0J6Jbv21z6",
"walletId": "AAEAAAMhEgNuYNRKX1d4T4mX"
}
POST /v2/alfred/platform/{platformId}/walletauthentication
Platform Id -> AAEAAABjvIbjm5q02jtViKul
{
"externalReferenceId": "someuser123"
}
RESPONSE:
- walletId
- accessToken
GET /v2/wallet/wallets/{walletId}
walletId -> AAEAAAMhEgNuYNRKX1d4T4mX
RESPONSE:
- walletAccountId
POST /v2/wallet/tx/payments/session
{
"paymentType": "Funding",
"walletAccountId": "AAEAAAPzPsdDtc5zLAbWU7vO"
}
RESPONSE:
- paymentSessionId
- paymentInstrumentId
POST /v2/wallet/tx/payments
{
"description": "string",
"paymentAmount": 20,
"paymentCurrency": "BDT",
"paymentSessionDetailsJson": {
"selectedPaymentMethod": "cash",
"selectedPaymentInstrumentId": "AAEAAAQiQsrN1V38STZquT3K"
},
"paymentSessionId": "AAEAAAkPksjml5NRTwiaHdOV",
"walletAccountId": "AAEAAAPzPsdDtc5zLAbWU7vO"
}
RESPONSE:
- id
POST /v2/wallet/tx/payments/{paymentId}:confirm
NOTE: After this step, the user has balance in his account. We can create a purchase to use that balance.
POST /v2/alfred/purchase
{
"amount": 10,
"billingAddress": "string",
"currency": "BDT",
"customType": "string",
"description": "string",
"shippingAddress": "string",
"shopConfigurationId": "AAEAAADt1_43vWGIS1iow1I1"
}
RESPONSE: data.id
POST /v2/alfred/purchase/{purchaseId}/session
purchaseId -> AAEAAADt1_43rYRptnv83x9R
{
"countryCode": "BD",
"walletId": "AAEAAAMhEgNuYNRKX1d4T4mX"
}
RESPONSE:
- paymentSessionId
- paymentInstrumentId
NOTE: The result shows that a part of the purchase can be payed in balance and the rest with another payment instrument.
POST /v2/alfred/purchase/{purchaseId}:confirm
purchaseId -> AAEAAADt1_43rYRptnv83x9R
{
"paymentSessionDetails": {
"selectedPaymentMethod": "cash",
"selectedPaymentInstrumentId": "AAEAAAQiQsrNy63ZthIylgCo"
},
"paymentSessionId": "AAEAAAkPksjmif0J6Jbv21z6",
"walletId": "AAEAAAMhEgNuYNRKX1d4T4mX"
}
NOTE: Check the user balance in the Admin UI.