Payments, refunds and payouts in one API
Send customers to our ready-made payment page, or take card details in your own checkout. Test everything in Sandbox first, with your own keys.
POST/v1/payments/hppSandbox key
curl -X POST https://api.ecomm365.eu/v1/payments/hpp \ -H "Authorization: Bearer $ECOMM_API_KEY" \ -H "Idempotency-Key: order-2345678901-hpp-1" \ -H "Content-Type: application/json" \ -d '{ "amount": 12900, "currency": "EUR", "customer_ip_address": "203.0.113.7", "return_url": "https://shop.example/checkout/complete" }'
201 CreatedRequest-Id: req_7Hn2Qx9Lw4Bd
{ "id": "pay_q7Mk2Np8Vr4Xt6Yz9Ab3Cd5E", "status": "REQUIRES_ACTION", "next_action": { "reason": "hosted_payment_page", … }}
POST/v1/paymentsSandbox key
curl -X POST https://api.ecomm365.eu/v1/payments \ -H "Authorization: Bearer $ECOMM_API_KEY" \ -H "Idempotency-Key: order-1234567890-direct-1" \ -H "Content-Type: application/json" \ -d '{ "amount": 12900, "currency": "EUR", "customer_ip_address": "203.0.113.7", "payment_method_data": { "type": "card", "card": { "number": "4635440000002207", "exp_month": 12, "exp_year": 2027, "cvc": "314" } }, "return_url": "https://shop.example/checkout/3ds-return" }'
201 CreatedRequest-Id: req_3Kp8Vt1Zm6Qa
{ "id": "pay_q7Mk2Np8Vr4Xt6Yz9Ab3Cd5E", "status": "REQUIRES_ACTION", "next_action": { "reason": "three_d_secure", … }}
POST/v1/refundsSandbox key
curl -X POST https://api.ecomm365.eu/v1/refunds \ -H "Authorization: Bearer $ECOMM_API_KEY" \ -H "Idempotency-Key: refund-ord_1234-1" \ -H "Content-Type: application/json" \ -d '{ "payment_id": "pay_q7Mk2Np8Vr4Xt6Yz9Ab3Cd5E", "amount": 4500, "reason": "Customer requested a partial refund" }'
201 CreatedRequest-Id: req_9Wc4Ne7Ry2Hs
{ "id": "ref_L9xQ4wE2rT8yU6iO3pA7sD1f", "refund_type": "PARTIAL", "status": "PROCESSING"}
POST/v1/payoutsSandbox key
curl -X POST https://api.ecomm365.eu/v1/payouts \ -H "Authorization: Bearer $ECOMM_API_KEY" \ -H "Idempotency-Key: payout-ord_5678-1" \ -H "Content-Type: application/json" \ -d '{ "amount": 2500, "currency": "EUR", "destination": { "card_number": "4111111111111111" }, "initiator_ip_address": "203.0.113.7", "recipient": { "country": "DE", "first_name": "Jenny", "last_name": "Rosen" } }'
201 CreatedRequest-Id: req_5Jd1Lb8Tx3Gf
{ "id": "po_7Qr3Lm9Ns2Vx6Za8Bc4Df1Gh", "status": "PENDING", "recipient": { "country": "DE", … }}
Two ways to take a payment
Both start with one request from your site and end with the same payment in your portal.
Nine endpoints. That's the whole API.
Every request except the health check uses your secret key. The same address serves Sandbox and Live; the key decides which one you're in.
/v1/paymentsCard details from your checkout
POST/v1/payments/hppA payment on our page
GET/v1/paymentsYour payments
GET/v1/payments/{id}One payment
/v1/refundsFull or partial
HealthIs the API up
GET/v1/healthAPI availability
/v1/payoutsA card payout
GET/v1/payoutsYour payouts
GET/v1/payouts/{payout_id}One payout
Safe to send twice
Every request that creates something carries an Idempotency-Key. If the connection drops and you send the same request again, no second payment is made.
- One key, one paymentUse your order number and attempt number in the key, so a retry is easy to recognise.
- A Request-Id on every answerInclude it when you contact support, and we find the request.
Webhooks for every change
Add an endpoint in the portal and we tell your server each time a payment, refund or payout changes.
15 events
One for each change of a payment, refund or payout, sent to your server as it happens.
Keys for each purpose
Create up to ten keys in Sandbox and ten in Live, one for each server or shop. A key is shown once, when you create it.
- Sandbox and Live apartTest keys start with api_test_sk_, live ones with api_live_sk_.
- Revoked in a minuteRevoking a key needs your password, and the key stops working within a minute.
- Developers get their own roleThey manage keys and webhooks, and only view payments and balances.
Try every answer before you go live
Once your test account is set up, pay with a test card and choose the amount: a few amounts always give the same result, so you can see how your shop handles a decline or an error.
- Visa test card
4635 4400 0000 2207 - Mastercard test card
5520 3300 0000 2205