Paydoro API Documentation

The flow

1 - User chooses to pay with gift cards on your website.
2 - You redirect the user to our payment page.
3 - After the successful payment we send an IPN request to your server, this is done server to server.
4 - User is redirected to your website with an order id.
5 - You get all the details with API and show success or failure message to the user.

Initiate the payment.

You need to redirect the user to our payment page with the following query string (GET) parameters:
nonce - (required) current timestamp, needed to avoid browser cache
apikey - (required) your api key
userid - (required) unique id of your customer that you can track, it will be attached to the payment (use email for simplicity)
callbackurl - (required) the page where we redirect the user after the payment, we will add 'orderid' query string to the url if the payment is successful

fixedamount - (optional) put an amount (integer) if user needs to pay an exact amount, no decimals accepted
customid - (optional) you can send unique identification of the order that you can track, this has to be unique each time you redirect the user
description - (optional) item or subscription description to show on payment screen

IMPORTANT: All the parameters have to be URL Encoded

URL: https://paydoro.com/merchant-api/neworder

Sample:
https://paydoro.com/merchant-api/neworder?nonce={value}&apikey={value}&userid={value}&callbackurl={value}&fixedamount=[value]&customid=[value]&description=[value]
Replace parameters with your values or remove optionals if not needed

IMPORTANT: be aware that user can be redirected to the callbackurl multiple times, you need to release the payment only once and make sure that you have released the payment for this orderid each time if the payment was successful.

IPN Page

For each successful transaction and each time the status of the payment is changed, we will send a notification to the configured url with a single query string parameter "orderid".
You should use this order id to get the Order Status as described below and apply appropriate changes on your backend depending on the status.

IMPORTANT: this is a server to server HTTP(s) request.
IMPORTANT: this page has to return a plain text that contains "ok-{txnid}-{status}", "txnid" and "status" has to be the last values you got from Get Order Status method.
We will be sending IPN until we receive the correct response and if you fail to return it multiple times, you can be penalized or deactivated.
The transaction will not be completed and you cannot withdraw until we receive the correct response from the IPN.
example: "ok-cbw262sz-good" or "ok-cbw262sz-completed" etc

Sample IPN url:

http://yourwebsite.com/paydoro-ipn.php?orderid=sampleorderid12345

Server Side Code

Get Order Status
Even if you had a positive response on client side, you need to verify the status of the payment with the server side API.
URL: https://paydoro.com/merchant-api/getorder
POST: JSON OBJECT

{
    "apikey": "your api key",
    "orderid": "order id assigned by Paydoro returned on client side or on IPN page"
};

HEADER:
API-SECRET: your api secret
Response: JSON OBJECT
{
    "orderid": "order id assigned by Paydoro"
    "userid": "userid that you have sent",,
    "totalamount": "credit amount after deducting card type fee, this is the amount that you need to release",
    "amountpaidtoyou": "paid to you after fees deducted",
    "status": "new|processing|good|completed|cancelled"
    "customid": "customid that you have sent or empty if not applied",
    "txnid": "transaction id, better readable for users",
    "cardtype": "card type ex: walmart, applestore, target, amazon",
    "cardlastfour": "last four digits/symbols of the card number",
    "cardvalue": "total card value submitted, just for your record if you need",
    "cardtypefee": "fee deducted from the card value for card types with lower market rates or complex selling methods"
};
status:
new - the user has opened a transaction but has not submitted a gift card for payment.
processing - the user has submitted a gift card, but it's still being processed.
good - the payment was successfully processed and you can release the credits to the user or complete checkout if you wish
completed - paid and available for withdrawal
cancelled - cancelled due to bad card


Download PHP Sample Code to use on your server side