Appendix
All API calls need to be authenticated, which is done by adding a Basic header that includes your API Username and API Password converted to Base64 (instructions on how to find your creds are here). In Postman or Insomnia, you can easily add these as “Username” and “Password” under “Basic” headers or “Basic Auth,” respectively (they are automatically converted to Base64). You can also just use an online Base64 converter.
Refunding part or all of a plan is achieved by calling the Refund API and passing in the plan number along with the desired refund amount. Note that the default refund strategy is
FutureInstallmentsFirst
. curl --request POST \
--url https://webapi.sandbox.splitit.com/api/InstallmentPlan/Refund \
--header 'Authorization: Basic QVBJVXNlcjAwMDAzMjIwMDp0QjJyam9XeTdjWDdiQnlkTUZiWWo2UUZ2OFU5M1NvWlBZeHdTdFN3TVhqUTVYZTJaMA==' \
--header 'Content-Type: application/json' \
--data '{
"InstallmentPlanNumber": "62787747637784516814",
"Amount": {
"Value": "150"
},
"RefundStrategy": "FutureInstallmentsFirst"
}
'
Cancel a plan by passing the plan number to the Cancel API. You will need specify how to handle refunds (either
NoRefunds
, meaning the plan won’t be refunded at all, or OnlyIfAFullRefundIsPossible
, meaning that the plan will be cancelled only if full refunds for all past installments have been completed. curl --request POST \
--url https://webapi.sandbox.splitit.com/api/InstallmentPlan/Cancel \
--header 'Authorization: Basic QVBJVXNlcjAwMDAzMjIwMDp0QjJyam9XeTdjWDdiQnlkTUZiWWo2UUZ2OFU5M1NvWlBZeHdTdFN3TVhqUTVYZTJaMA==' \
--header 'Content-Type: application/json' \
--data '{
"InstallmentPlanNumber": "48803706632888533534",
"RefundUnderCancelation": "NoRefunds"
}'
To receive a webhook showing that your plan was successfully finalized, you can add your desired endpoint to the the EventsEndpoints object when you call Initiate in Step 2.
“EventsEndpoints”: {
“CreateSucceeded”: “https://www.async-success.com/”
},
Last modified 8mo ago