Quickstart โ Direct Payment API ๐งถ
Go from zero to your first test payment in a few minutes.
1. Get connected to Paystrax and learn the prerequisites ๐งถโ
Before making any request, contact Paystrax Operations at [TODO: email] to get set up. They'll handle your initial onboarding and provide everything below:
| Item | Used as |
|---|---|
| API username and password | Obtain access tokens (see Getting an Access Token) |
| Token endpoint URL | POST to exchange credentials for a Bearer token |
| Integrator ID | X-Integrator-ID request header (case-sensitive) |
| Configuration ID | receiver.configuration_id in payment requests. See Testing & Sandbox Data for in depth details |
| Gateway base URL (TEST) | Prefix for all API paths โ https://sandbox-api.paystrax.com |
| Gateway base URL (PRODUCTION) | Confirmed separately with your Paystrax contact |
You'll need these credentials and the sandbox base URL before moving to the next step.
See Authentication & Environments for the full setup walkthrough.
2. Authenticate ๐งถโ
Every request must include your credentials. Use the token endpoint URL supplied in your PAYSTRAX welcome pack, and request a token using the OAuth2 password grant:
POST <token_endpoint_url>
Content-Type: application/x-www-form-urlencoded
client_id=<client_id_from_paystrax>&username=<api_username>&password=<api_password>grant_type=password
Read access_token from the JSON response, and use it as Authorization: Bearer <access_token> on every subsequent request until it expires โ then repeat this step.
3. Make one test payment ๐๏ธโ
The simplest possible case โ a single sale, no branching. intent: transfer authorises and captures in one step.
Request
curl -X POST https://sandbox-api.paystrax.com/payments \
-H "Authorization: Bearer <access_token>" \
-H "X-Integrator-ID: <integrator_id>" \
-H "Content-Type: application/json" \
-d '{
"amount": 10101,
"currency": "EUR",
"sender": {
"type": "credit_card",
"custom_data": {
"pan": "5341260000000056",
"expiry_month": "12",
"expiry_year": "2033",
"holder_name": "John Snow"
}
},
"receiver": { "configuration_id": "<CONFIGURATION_ID>" },
"routing": { "payment_flow": "credit_card" },
"intent": "transfer",
"channel": "ecommerce",
"custom_data": { "authentication": { "cvc": "987" } },
"descriptors": { "reconciliation": "ORDER-1001" }
}'
4. Read the result ๐๏ธโ
Response โ the desired status is 201, meaning the request was accepted. Save these fields:
| Field | Purpose |
|---|---|
id | Payment ID โ used for GET, reverse, and webhooks |
initial_operation_id | Transfer ID for this sale |
network_transaction_reference | Scheme network reference |
Check custom_data.transaction_iso_properties.processor_response_code โ 00 means approved at the processor level. A 201 response does not by itself mean the payment succeeded โ always check this field, not the HTTP status alone.
Confirm Once you've read the result, verify it independently with a follow-up GET:
curl -X GET https://sandbox-api.paystrax.com/payments/<payment_id> \
-H "Authorization: Bearer <access_token>" \
-H "X-Integrator-ID: <integrator_id>"
5. Next steps ๐๏ธโ
- Explore the other payment flows โ authorise, refund, payout, fund a card โ in Payment Flows, or dive into the full API Reference.
- Learn how to handle errors and declined payments in Error Handling and Response Statuses.
- Learn how to manage back-office operations in Back Office Payment Operations.
- Set up webhooks to receive updates from the API in Webhooks.