Skip to content
agovena.
agovena.
Get started
Community

API overview

Start a gateway payment attempt

Choose an operation to see its request, response shape, access rules and implementation source.

WriteAuthenticated

POST/api/v1/orders/{order}/pay

Start a gateway payment attempt

Sanctum session or bearer token. Required bearer ability: orders.pay

Request
FieldInRule
orderPath parameterRequired numeric ID owned by the authenticated customer. Foreign and missing IDs return 404.
gatewayJSON bodyRequired registered gateway ID string; max 40.
return_url, cancel_urlJSON bodyRequired URLs; max 500 each. Origins must be allowed by the installation; credentials and fragments are rejected.
idempotency_keyJSON bodyNullable string; max 64. Keep separate from the checkout key.
Idempotency-KeyHeaderOptional fallback only if idempotency_key is absent from the body.
cURL
curl --request POST "https://shop.example.test/api/v1/orders/$ORDER_ID/pay" \
  --header 'Accept: application/json' \
  --header "Authorization: Bearer $API_TOKEN" \
  --header 'Content-Type: application/json' \
  --data '{"gateway":"<registered-gateway-id>","return_url":"https://shop.example.test/payment-return","cancel_url":"https://shop.example.test/payment-cancel","idempotency_key":"example-payment-01"}'
Response200
Success: 200

Response shape (notation, not a captured response)

schema
{ data: { attempt_id: integer, status: string, redirect_url: string|null, payment_status: string|null } }

Full response schema

Common errors
HTTP statusMeaning
401unauthenticated: missing or invalid authentication.
403unauthorized, insufficient_scope or ip_not_allowed: check account context, required ability and token IP policy.
404not_found: missing, inactive or foreign-owned resource.
422validation_error: invalid input or unmet domain requirements. Payment initiation can also return payment_failed.
429rate_limited: back off before retrying, especially writes.
Error envelope and global caveats

Search documentation

Search guides, commands and API endpoints

What are you looking for?

Documentation