Guides
This is a collection of some of the most common use cases for NeoDeos. If you're looking to get started, this is the place to come.
Processing a Card Payment
- curl
curl -d '{"Amount":"20", "ProviderId":"a26c371f94f640daadd228ec8e9da8ed", "PaymentInformation" : {"CardNumber" : "4111111111111111", "ExpiryDate" : "12/22", "Ccv" : "123"}}' \
-H "Content-Type: application/json" \
-H "x-secretkey: <secret_key>" \
-X POST https://sandbox-api.neodeos.com/charge/card
For all parameters to the API, see Create Charge
Processing a Tokenized Payment
First, use the Client SDK to tokenize the user’s payment details securely. Once you have the token, pass it to your backend to process the payment through the payment gateway..
- curl
curl -d '{"Amount":"20", "Token":"5db53c06443c8f28c0cba6e5"}' \
-H "Content-Type: application/json" \
-H "x-secretkey: <secret_key>" \
-X POST https://sandbox-api.neodeos.com/charge/token
For all parameters to the API, see Create Charge with a bank account
Set Up Customer Profile
If you want to accept payments for the same payment details more than once, it's best to create a customer.
First, use the Client SDK to securely convert the payment details to a payment token. You can then use that token to create a customer:
- curl
curl -d '{"FirstName":"John", "LastName":"Doe", "Reference":"123", "Token":"5db53c06443c8f28c0cba6e5"}' \
-H "Content-Type: application/json" \
-H "x-secretkey: <secret_key>" \
-X POST https://sandbox-api.neodeos.com/customer/token
For all parameters to the API, see Create Customer
Processing a Customer Payment
If you already have a customer, you can use that customer to accept a payment for that customer.
- curl
curl -d '{"Amount":"20", "ProviderId":"7eeeb601-2992-486d-8dc9-f788eef26f95", "CustomerId":"95af2d87-36a6-499d-87c8-e887a3498f1e"}' \
-H "Content-Type: application/json" \
-H "x-secretkey: <secret_key>" \
-X POST https://sandbox-api.neodeos.com/charge/customer
For all parameters to the API, see Create a Charge for a Customer
Setting Up a Payment Method
If you want to accept payments for the same payment details more than once but do not want to create a customer, you can create a payment method.
- curl
curl -d '{"ProviderId":"a26c371f94f640daadd228ec8e9da8ed", "PaymentInformation" : {"CardNumber" : "4111111111111111", "ExpiryDate" : "12/22", "Ccv" : "123"}}' \
-H "Content-Type: application/json" \
-H "x-secretkey: <secret_key>" \
-X POST https://sandbox-api.neodeos.com/payment_method/card
For all parameters to the API, see Create Payment Method
Processing a Payment Using a Payment Method
If you already have a payment method, you can use that payment method to accept a payment for that payment method.
- curl
curl -d '{"Amount":"20", "PaymentMethodId":"154d5c8940db4d76ba9334fb44241aa4", "Currency":"USD"}' \
-H "Content-Type: application/json" \
-H "x-secretkey: <secret_key>" \
-X POST https://sandbox-api.neodeos.com/charge/payment_method
For all parameters to the API, see Create a Charge for a Payment Method
Return of Funds
If payment status is SUCCESS or PARTIAL_REFUND you can refund this payment by using the Refund method.
- curl
curl --location --request DELETE 'https://sandbox-api.neodeos.com/refund/b59efd7afd9949fbb1d5aed4cf83aedb' \
-H 'x-secretkey: <secret_key>' \
-H 'Content-Type: application/json'
Approve and Settle
Any payment request could have a Capture parameter (by default Capture = true) and you can decide whether you want to have payment captured immediately or not.
If payment was created with Capture = false it means that status of this payment is Authorised. You can complete this payment by using the Capture method.
- curl
curl -d '{"Amount":"20", "Currency" : "USD", "CustomerId":"95af2d87-36a6-499d-87c8-e887a3498f1e", "Capture": false}' \
-H "Content-Type: application/json" \
-H "x-secretkey: <secret_key>" \
-X POST https://sandbox-api.neodeos.com/charge/customer
curl --location --request POST 'https://sandbox-api.neodeos.com/charge/b59efd7afd9949fbb1d5aed4cf83aedb' \
-H 'x-secretkey: <secret_key>' \
-H 'Content-Type: application/json' \
-d '{
"Amount": 20
}'
Cancel Transaction
If status of payment is Authorised you can cancel it by the Void method.
- curl
curl -d '{"Amount":"20", "Currency" : "USD", "CustomerId":"95af2d87-36a6-499d-87c8-e887a3498f1e", "Capture": false}' \
-H "Content-Type: application/json" \
-H "x-secretkey: <secret_key>" \
-X POST https://sandbox-api.neodeos.com/charge/customer
curl --location --request DELETE 'https://sandbox-api.neodeos.com/charge/b59efd7afd9949fbb1d5aed4cf83aedb/void' \
-H 'x-secretkey: <secret_key>' \
-H 'Content-Type: application/json'
Transaction Lookup
You may want to check whether a transaction has succeeded or search for past transactions for a customer.
- curl
curl -H "Content-Type: application/json" \
-H "x-secretkey: <secret_key>" \
-X GET https://sandbox-api.neodeos.com/charge?reference=123
For all parameters to the API, see Search for Transactions
Customer Lookup
You may want to search for a specific customer based on email address or name.
- curl
curl -H "Content-Type: application/json" \
-H "x-secretkey: <secret_key>" \
-X GET https://sandbox-api.neodeos.com/customer?email=john.doe@gmail.com
For all parameters to the API, see Search for Customers