GTRADEDocs
Reference

API reference

All endpoints of the GTRADE API v1 on one page. Base URL https://api.gtradegateway.io.

#Conventions

  • Base URL: https://api.gtradegateway.io. All endpoints are under /v1.
  • Authentication: Authorization: Bearer <your API key> (or X-API-Key). See Authentication.
  • Format: JSON request and response bodies in UTF-8. Send Content-Type: application/json with a body. Request bodies are limited to 64 KB.
  • Amounts: JSON numbers in USD. Timestamps: ISO-8601 in UTC.
  • Errors: a JSON error object with type, code, message and request_id. See Errors.

#Endpoints

MethodPathDescription
GET/v1/healthService health. No authentication.
POST/v1/paymentsCreate a payment.
GET/v1/payments/{id}Retrieve a payment.
GET/v1/paymentsList payments (limit, status, starting_after).
POST/v1/webhooksRegister a webhook endpoint.
GET/v1/webhooksList webhook endpoints.
DELETE/v1/webhooks/{id}Delete a webhook endpoint.
POST/v1/webhooks/{id}/testSend a test event.

#Response headers

HeaderMeaning
X-Request-IdUnique id of the request (also request_id in error bodies). Quote it when you contact support.
X-RateLimit-Limit, X-RateLimit-RemainingYour per-key request budget. See Rate limits.
Retry-AfterSeconds to wait, on 429 responses.
Idempotent-Replayed: truePOST /v1/payments returned an earlier result for the same idempotency key.
Cache-Control: no-storeResponses must not be cached.

#Objects

#Payment

See the Payment object. Statuses: open, pending, partially_paid, paid, cancelled (details).

#List

json
{ "object": "list", "data": [ ... ], "has_more": false }

has_more is only returned by GET /v1/payments.

#Webhook endpoint

FieldTypeDescription
idstringwh_…
objectstring"webhook_endpoint"
urlstringYour HTTPS URL.
created_atstringISO-8601 UTC.

#Webhook delivery

Returned by POST /v1/webhooks/{id}/test.

FieldTypeDescription
idstringdlv_…, also sent as the X-Gtrade-Delivery header.
objectstring"webhook_delivery"
webhook_idstringThe endpoint.
event_idstringevt_…
event_typestringpayment.test
statusstringsucceeded, or pending if the first attempt failed and a retry is scheduled.
response_statusnumber or nullHTTP status your endpoint returned, null on a connection error.

#Event

See Event payload.

#Health check

bash
curl -i https://api.gtradegateway.io/v1/health
http
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
X-Request-Id: req_9287ace0f6037aec
Cache-Control: no-store

{"status":"ok"}