PovitoDevelopers

Checkout API

Povito Checkout API v1.0.0-draft.5

Hosted, embeddable checkout for Povito merchants

Download contract checkout-v1.yaml Try requests in the Sandbox explorer

30 operations, generated at build time from the contract. Keys and base URLs for each environment: Keys and environments.

Base URLs#

EnvironmentBase URL
Livehttps://api.checkout.povito.com/v1
Sandbox Staginghttps://api.checkout.staging.povito.com/v1
Localhttp://localhost:9100/v1

Overview#

Take payments through Povito Checkout: your server creates a checkout session, the shopper pays on Povito's hosted page, and you are told the result by a signed webhook — then confirm it by reading the session.

Money is integer minor units of the currency. IQD has no minor unit (45000 is forty-five thousand dinars); USD is cents.

A webhook is a prompt to GET /checkout/sessions/{id}. The session is the only authoritative state — never act on a webhook body alone.

Test mode is a key mode. A povito_ck_test_… key drives the simulated test gateway and never moves real money; see the Testing guide.

Authentication#

secretKey#

HTTP bearerAuthorization: Bearer …

povito_ck_live_… or povito_ck_test_… — server-side only

publishableKey#

HTTP bearerAuthorization: Bearer …

povito_pk_live_… or povito_pk_test_… — safe in a browser or app; unlocks /public/* only

customerToken#

API key in header X-Povito-Customer-Token

Session-scoped token issued by OTP verification

Endpoints#

Sessions

GET /checkout/sessions#

listCheckoutSessions · secretKey

List sessions, typically by reference_id

Parameters

NameInTypeNotes
reference_idquerystring
max length 128
statusquerySessionStatus
created_afterquerystring (date-time)
limitqueryinteger
default 20 · min 1 · max 100
cursorquerystring

Responses

StatusMeaningBody
200OK
inline schema
FieldTypeNotes
datarequiredarray of CheckoutSession
next_cursorrequiredstring | null
401Missing or invalid keyErrorEnvelope · Unauthorized

Examples

Sandboxbash
curl "https://api.checkout.staging.povito.com/v1/checkout/sessions" \
  -H "Authorization: Bearer povito_ck_test_..."

POST /checkout/sessions#

createCheckoutSession · secretKey

Create a checkout session and get the URL to send the shopper to

Parameters

NameInTypeNotes
Idempotency-KeyrequiredheaderstringSame key + same body replays the first response; same key + different body is 409. A UUID is the usual choice
pattern ^[A-Za-z0-9_-]{8,128}$

Request body application/json · required

CheckoutSessionCreate

Responses

StatusMeaningBody
200An open session already exists for this reference_id in this mode; it is returned unchangedCheckoutSession
201Created
header Idempotent-ReplayedIdempotentReplayed
CheckoutSession
400Validation errorErrorEnvelope · BadRequest
401Missing or invalid keyErrorEnvelope · Unauthorized
403Insufficient scope, mode mismatch, or suspended merchantErrorEnvelope · Forbidden
409Idempotency conflict, wrong state, or refund ceilingErrorEnvelope · Conflict
422Business ruleErrorEnvelope · Unprocessable
429Too many requests
header Retry-After
ErrorEnvelope · RateLimited

Examples

Sandboxbash
curl -X POST "https://api.checkout.staging.povito.com/v1/checkout/sessions" \
  -H "Authorization: Bearer povito_ck_test_..." \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "reference_id": "cart_01J8Z3K9Q4M2XA7B",
  "amount": 45000,
  "currency": "IQD",
  "line_items": [
    {
      "label": "Basket",
      "amount": 42000,
      "type": "charge"
    },
    {
      "label": "Delivery — Hi-Express",
      "amount": 5000,
      "type": "shipping"
    },
    {
      "label": "Coupon RAMADAN",
      "amount": 2000,
      "type": "discount"
    }
  ],
  "payment_method_types": [
    "zaincash"
  ],
  "customer": {
    "phone": "+9647800000000",
    "name": "Ali M. Ismail"
  },
  "collect": {
    "phone": "required",
    "name": "required",
    "shipping_address": "none"
  },
  "locale": "ar",
  "success_url": "https://povito.com/ar/checkout/payment/return",
  "cancel_url": "https://povito.com/ar/checkout",
  "metadata": {
    "cart_id": "cart_01J8Z3K9Q4M2XA7B"
  }
}'

GET /checkout/sessions/{id}#

getCheckoutSession · secretKey

Authoritative session state — the verify call

Parameters

NameInTypeNotes
idrequiredpathstring
pattern ^cs_(live|test)_[A-Za-z0-9]+$

Responses

StatusMeaningBody
200OKCheckoutSession
401Missing or invalid keyErrorEnvelope · Unauthorized
403Insufficient scope, mode mismatch, or suspended merchantErrorEnvelope · Forbidden
404Not found (also returned for another merchant's objects)ErrorEnvelope · NotFound

Examples

Sandboxbash
curl "https://api.checkout.staging.povito.com/v1/checkout/sessions/{id}" \
  -H "Authorization: Bearer povito_ck_test_..."

POST /checkout/sessions/{id}/expire#

expireCheckoutSession · secretKey

Close an open session

Parameters

NameInTypeNotes
idrequiredpathstring
pattern ^cs_(live|test)_[A-Za-z0-9]+$

Responses

StatusMeaningBody
200ExpiredCheckoutSession
404Not found (also returned for another merchant's objects)ErrorEnvelope · NotFound
409Idempotency conflict, wrong state, or refund ceilingErrorEnvelope · Conflict

Examples

Sandboxbash
curl -X POST "https://api.checkout.staging.povito.com/v1/checkout/sessions/{id}/expire" \
  -H "Authorization: Bearer povito_ck_test_..."

Payment methods

GET /payment_methods#

listPaymentMethods · secretKey

Methods this merchant may pass in payment_method_types, in display order

Responses

StatusMeaningBody
200OK
inline schema
FieldTypeNotes
datarequiredarray of PaymentMethod
401Missing or invalid keyErrorEnvelope · Unauthorized

Examples

Sandboxbash
curl "https://api.checkout.staging.povito.com/v1/payment_methods" \
  -H "Authorization: Bearer povito_ck_test_..."

Refunds

GET /refunds#

listRefunds · secretKey

Parameters

NameInTypeNotes
session_idquerystring
limitqueryinteger
default 20 · min 1 · max 100
cursorquerystring

Responses

StatusMeaningBody
200OK
inline schema
FieldTypeNotes
datarequiredarray of Refund
next_cursorrequiredstring | null

Examples

Sandboxbash
curl "https://api.checkout.staging.povito.com/v1/refunds" \
  -H "Authorization: Bearer povito_ck_test_..."

POST /refunds#

createRefund · secretKey

Refund part or all of a paid session

Parameters

NameInTypeNotes
Idempotency-KeyrequiredheaderstringSame key + same body replays the first response; same key + different body is 409. A UUID is the usual choice
pattern ^[A-Za-z0-9_-]{8,128}$

Request body application/json · required

RefundCreate

Responses

StatusMeaningBody
201Created
header Idempotent-ReplayedIdempotentReplayed
Refund
400Validation errorErrorEnvelope · BadRequest
404Not found (also returned for another merchant's objects)ErrorEnvelope · NotFound
409Idempotency conflict, wrong state, or refund ceilingErrorEnvelope · Conflict
422Business ruleErrorEnvelope · Unprocessable

Examples

Sandboxbash
curl -X POST "https://api.checkout.staging.povito.com/v1/refunds" \
  -H "Authorization: Bearer povito_ck_test_..." \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "session_id": "session_id",
  "amount": 0,
  "reason": "reason",
  "metadata": {
    "key": "string"
  }
}'

GET /refunds/{id}#

getRefund · secretKey

Parameters

NameInTypeNotes
idrequiredpathstring

Responses

StatusMeaningBody
200OKRefund
404Not found (also returned for another merchant's objects)ErrorEnvelope · NotFound

Examples

Sandboxbash
curl "https://api.checkout.staging.povito.com/v1/refunds/{id}" \
  -H "Authorization: Bearer povito_ck_test_..."

Webhook endpoints

Endpoints belong to one mode. A key lists and manages only endpoints of its own mode; every /webhook_endpoints/{id} operation on an endpoint of the other mode returns 404 endpoint_not_found.

GET /webhook_endpoints#

listWebhookEndpoints · secretKey

Responses

StatusMeaningBody
200OK
inline schema
FieldTypeNotes
datarequiredarray of WebhookEndpoint

Examples

Sandboxbash
curl "https://api.checkout.staging.povito.com/v1/webhook_endpoints" \
  -H "Authorization: Bearer povito_ck_test_..."

POST /webhook_endpoints#

createWebhookEndpoint · secretKey

Register an endpoint; the signing secret is returned once

Request body application/json · required

WebhookEndpointCreate

Responses

StatusMeaningBody
201Created — secret is present only in this responseWebhookEndpointWithSecret
400Validation errorErrorEnvelope · BadRequest
422Business ruleErrorEnvelope · Unprocessable

Examples

Sandboxbash
curl -X POST "https://api.checkout.staging.povito.com/v1/webhook_endpoints" \
  -H "Authorization: Bearer povito_ck_test_..." \
  -H "Content-Type: application/json" \
  -d '{
  "url": "https://example.com",
  "events": [
    "*"
  ],
  "mode": "live",
  "description": "description"
}'

GET /webhook_endpoints/{id}#

getWebhookEndpoint · secretKey

Parameters

NameInTypeNotes
idrequiredpathstring

Responses

StatusMeaningBody
200OKWebhookEndpoint
404Not found (also returned for another merchant's objects)ErrorEnvelope · NotFound

Examples

Sandboxbash
curl "https://api.checkout.staging.povito.com/v1/webhook_endpoints/{id}" \
  -H "Authorization: Bearer povito_ck_test_..."

PATCH /webhook_endpoints/{id}#

updateWebhookEndpoint · secretKey

Parameters

NameInTypeNotes
idrequiredpathstring

Request body application/json · required

FieldTypeNotes
urlstring (uri)
eventsarray of EventType
statusstring
one of "enabled", "disabled"
descriptionstring
max length 200

Responses

StatusMeaningBody
200OKWebhookEndpoint
404Not found (also returned for another merchant's objects)ErrorEnvelope · NotFound

Examples

Sandboxbash
curl -X PATCH "https://api.checkout.staging.povito.com/v1/webhook_endpoints/{id}" \
  -H "Authorization: Bearer povito_ck_test_..." \
  -H "Content-Type: application/json" \
  -d '{
  "url": "https://example.com",
  "events": [
    "*"
  ],
  "status": "enabled",
  "description": "description"
}'

DELETE /webhook_endpoints/{id}#

deleteWebhookEndpoint · secretKey

Delete an endpoint; its delivery history stays on the events

Deliveries to the endpoint stop at once. It is no longer listed or readable — 404 endpoint_not_found afterwards, including for a second DELETE — and receives no new events or redeliveries. Retries already scheduled for it are cancelled: they appear in GET /events/{id} deliveries with error: "endpoint_deleted" and no next_retry_at. Its signing secrets are destroyed. Past delivery attempts stay on the events they belong to. To pause deliveries instead, PATCH it with status: disabled.

Parameters

NameInTypeNotes
idrequiredpathstring

Responses

StatusMeaningBody
204Deleted
404Not found (also returned for another merchant's objects)ErrorEnvelope · NotFound

Examples

Sandboxbash
curl -X DELETE "https://api.checkout.staging.povito.com/v1/webhook_endpoints/{id}" \
  -H "Authorization: Bearer povito_ck_test_..."

POST /webhook_endpoints/{id}/rotate_secret#

rotateWebhookSecret · secretKey

Issue a new secret; the old one is accepted for 24 hours

Parameters

NameInTypeNotes
idrequiredpathstring

Responses

StatusMeaningBody
200OKWebhookEndpointWithSecret
404Not found (also returned for another merchant's objects)ErrorEnvelope · NotFound

Examples

Sandboxbash
curl -X POST "https://api.checkout.staging.povito.com/v1/webhook_endpoints/{id}/rotate_secret" \
  -H "Authorization: Bearer povito_ck_test_..."

POST /webhook_endpoints/{id}/test#

sendTestWebhook · secretKey

Parameters

NameInTypeNotes
idrequiredpathstring

Request body application/json · required

FieldTypeNotes
typerequiredEventType

Responses

StatusMeaningBody
202Queued
inline schema
FieldTypeNotes
event_idstring
404Not found (also returned for another merchant's objects)ErrorEnvelope · NotFound

Examples

Sandboxbash
curl -X POST "https://api.checkout.staging.povito.com/v1/webhook_endpoints/{id}/test" \
  -H "Authorization: Bearer povito_ck_test_..." \
  -H "Content-Type: application/json" \
  -d '{
  "type": "*"
}'

Events

GET /events#

listEvents · secretKey

Parameters

NameInTypeNotes
typequeryEventType
sincequerystring (date-time)
limitqueryinteger
default 20 · min 1 · max 100
cursorquerystring

Responses

StatusMeaningBody
200OK
inline schema
FieldTypeNotes
datarequiredarray of Event
next_cursorrequiredstring | null

Examples

Sandboxbash
curl "https://api.checkout.staging.povito.com/v1/events" \
  -H "Authorization: Bearer povito_ck_test_..."

GET /events/{id}#

getEvent · secretKey

Parameters

NameInTypeNotes
idrequiredpathstring

Responses

StatusMeaningBody
200OKEventWithDeliveries
404Not found (also returned for another merchant's objects)ErrorEnvelope · NotFound

Examples

Sandboxbash
curl "https://api.checkout.staging.povito.com/v1/events/{id}" \
  -H "Authorization: Bearer povito_ck_test_..."

POST /events/{id}/redeliver#

redeliverEvent · secretKey

Parameters

NameInTypeNotes
idrequiredpathstring

Responses

StatusMeaningBody
202Queued to every matching endpoint
inline schema
FieldTypeNotes
endpointsrequiredintegerHow many endpoints will receive it
404Not found (also returned for another merchant's objects)ErrorEnvelope · NotFound

Examples

Sandboxbash
curl -X POST "https://api.checkout.staging.povito.com/v1/events/{id}/redeliver" \
  -H "Authorization: Bearer povito_ck_test_..."

Public

GET /public/sessions/{code}#

publicGetSession · publishableKey

Page data for the hosted checkout and the drop-in

Parameters

NameInTypeNotes
coderequiredpathstring
pattern ^[A-Z0-9]{8,32}$
X-Povito-Customer-TokenheaderstringWhen valid for this session, the response carries the saved profile

Responses

StatusMeaningBody
200OKPublicSession
404Not found (also returned for another merchant's objects)ErrorEnvelope · NotFound
410session_expired or session_canceledErrorEnvelope

Examples

Sandboxbash
curl "https://api.checkout.staging.povito.com/v1/public/sessions/{code}" \
  -H "Authorization: Bearer povito_pk_test_..."

POST /public/sessions/{code}/otp#

publicRequestOtp · publishableKey

Parameters

NameInTypeNotes
coderequiredpathstring
pattern ^[A-Z0-9]{8,32}$

Request body application/json · required

FieldTypeNotes
phonerequiredPhoneE164

Responses

StatusMeaningBody
202Sent
inline schema
FieldTypeNotes
sentrequiredboolean
retry_afterrequiredintegerSeconds before a resend is accepted
429Too many requests
header Retry-After
ErrorEnvelope · RateLimited

Examples

Sandboxbash
curl -X POST "https://api.checkout.staging.povito.com/v1/public/sessions/{code}/otp" \
  -H "Authorization: Bearer povito_pk_test_..." \
  -H "Content-Type: application/json" \
  -d '{
  "phone": "+9647800000000"
}'

POST /public/sessions/{code}/otp/verify#

publicVerifyOtp · publishableKey

Parameters

NameInTypeNotes
coderequiredpathstring
pattern ^[A-Z0-9]{8,32}$

Request body application/json · required

FieldTypeNotes
phonerequiredPhoneE164
coderequiredstring
pattern ^[0-9]{6}$

Responses

StatusMeaningBody
200Verified — a session-scoped customer token
inline schema
FieldTypeNotes
customer_tokenrequiredstring
expires_atrequiredstring (date-time)
profilePublicCustomerProfile
400Validation errorErrorEnvelope · BadRequest
429Too many requests
header Retry-After
ErrorEnvelope · RateLimited

Examples

Sandboxbash
curl -X POST "https://api.checkout.staging.povito.com/v1/public/sessions/{code}/otp/verify" \
  -H "Authorization: Bearer povito_pk_test_..." \
  -H "Content-Type: application/json" \
  -d '{
  "phone": "+9647800000000",
  "code": "code"
}'

PUT /public/sessions/{code}/customer#

publicSetCustomer · publishableKey + customerToken

Parameters

NameInTypeNotes
coderequiredpathstring
pattern ^[A-Z0-9]{8,32}$

Request body application/json · required

FieldTypeNotes
namestring
max length 120
addressAddress

Responses

StatusMeaningBody
200OKPublicSession
400Validation errorErrorEnvelope · BadRequest

Examples

Sandboxbash
curl -X PUT "https://api.checkout.staging.povito.com/v1/public/sessions/{code}/customer" \
  -H "Authorization: Bearer povito_pk_test_..." \
  -H "X-Povito-Customer-Token: <token>" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "name",
  "address": {
    "governorate": "governorate",
    "city": "city",
    "line": "line",
    "landmark": "landmark",
    "country": "IQ",
    "geo": {
      "lat": 1.5,
      "lng": 1.5
    }
  }
}'

POST /public/sessions/{code}/attempts#

publicCreateAttempt · publishableKey + customerToken

Choose a method and start a payment attempt

Parameters

NameInTypeNotes
coderequiredpathstring
pattern ^[A-Z0-9]{8,32}$

Request body application/json · required

FieldTypeNotes
methodrequiredMethodCode
instrument_idstring
save_instrumentboolean
default false

Responses

StatusMeaningBody
201Attempt startedAttemptStart
409Idempotency conflict, wrong state, or refund ceilingErrorEnvelope · Conflict
422Business ruleErrorEnvelope · Unprocessable

Examples

Sandboxbash
curl -X POST "https://api.checkout.staging.povito.com/v1/public/sessions/{code}/attempts" \
  -H "Authorization: Bearer povito_pk_test_..." \
  -H "X-Povito-Customer-Token: <token>" \
  -H "Content-Type: application/json" \
  -d '{
  "method": "cashondelivery",
  "instrument_id": "instrument_id",
  "save_instrument": false
}'

GET /public/sessions/{code}/attempts/{attempt_id}#

publicGetAttempt · publishableKey

Poll an attempt; also triggers active reconciliation with the vendor

Parameters

NameInTypeNotes
coderequiredpathstring
pattern ^[A-Z0-9]{8,32}$
attempt_idrequiredpathstring

Responses

StatusMeaningBody
200OKAttemptPoll
404Not found (also returned for another merchant's objects)ErrorEnvelope · NotFound

Examples

Sandboxbash
curl "https://api.checkout.staging.povito.com/v1/public/sessions/{code}/attempts/{attempt_id}" \
  -H "Authorization: Bearer povito_pk_test_..."

GET /public/attempts/{attempt_id}#

publicGetAttemptById · publishableKey

Attempt lookup without the session code — for the return page on any browser

Parameters

NameInTypeNotes
attempt_idrequiredpathstring

Responses

StatusMeaningBody
200OK
inline schema

All fields of AttemptPoll, plus:

FieldTypeNotes
attempt_idrequiredstring
coderequiredstring
methodrequiredMethodCode
statusrequiredAttemptStatus
session_statusrequiredSessionStatus
payment_statusrequiredPaymentStatus
redirect_torequiredstring | null (uri)success_url with session_id and reference_id appended once the session completed; never a status
failure_reasonrequiredstring | null
presentrequiredobject | nullRe-shown on reload for present flows (FIB QR). qr_code is a data URI image.
fields
FieldTypeNotes
qr_codestring
readable_codestring
personal_app_linkstring (uri)
business_app_linkstring (uri)
valid_untilstring (date-time)
cancel_urlrequiredstring | null (uri)
merchantrequiredobject
fields
FieldTypeNotes
display_namestring
logo_urlstring | null (uri)
localerequiredLocale
livemoderequiredboolean
404Not found (also returned for another merchant's objects)ErrorEnvelope · NotFound

Examples

Sandboxbash
curl "https://api.checkout.staging.povito.com/v1/public/attempts/{attempt_id}" \
  -H "Authorization: Bearer povito_pk_test_..."

POST /public/sessions/{code}/cancel#

publicCancelSession · publishableKey

Parameters

NameInTypeNotes
coderequiredpathstring
pattern ^[A-Z0-9]{8,32}$

Responses

StatusMeaningBody
200Canceled
inline schema
FieldTypeNotes
redirect_tostring | null (uri)
409Idempotency conflict, wrong state, or refund ceilingErrorEnvelope · Conflict

Examples

Sandboxbash
curl -X POST "https://api.checkout.staging.povito.com/v1/public/sessions/{code}/cancel" \
  -H "Authorization: Bearer povito_pk_test_..."

GET /public/test-gateway/{attempt_id}#

publicTestGatewayDescribe · publishableKey

Test mode only — what the simulated vendor page shows

Parameters

NameInTypeNotes
attempt_idrequiredpathstring

Responses

StatusMeaningBody
200OK
inline schema
FieldTypeNotes
attempt_idrequiredstring
statusrequiredAttemptStatus
amountrequiredMinorUnits
currencyrequiredCurrency
methodrequiredMethodCode
return_urlrequiredstring (uri)
403Insufficient scope, mode mismatch, or suspended merchantErrorEnvelope · Forbidden

Examples

Sandboxbash
curl "https://api.checkout.staging.povito.com/v1/public/test-gateway/{attempt_id}" \
  -H "Authorization: Bearer povito_pk_test_..."

POST /public/test-gateway/{attempt_id}/decide#

publicTestGatewayDecide · publishableKey

Test mode only — the simulated vendor page's Succeed / Fail / Cancel / Slow buttons

Parameters

NameInTypeNotes
attempt_idrequiredpathstring

Request body application/json · required

FieldTypeNotes
decisionrequiredstring
one of "succeeded", "failed", "canceled", "slow"

Responses

StatusMeaningBody
200Decision applied and the attempt verified
inline schema
FieldTypeNotes
attempt_idstring
statusAttemptStatus
return_urlstring (uri)
403Insufficient scope, mode mismatch, or suspended merchantErrorEnvelope · Forbidden

Examples

Sandboxbash
curl -X POST "https://api.checkout.staging.povito.com/v1/public/test-gateway/{attempt_id}/decide" \
  -H "Authorization: Bearer povito_pk_test_..." \
  -H "Content-Type: application/json" \
  -d '{
  "decision": "succeeded"
}'

POST /callbacks/{mode}/{gateway}#

vendorCallback · no auth internal

Vendor callback target. A hint only — the attempt is verified against the vendor's status API before anything changes.

Parameters

NameInTypeNotes
moderequiredpathstring
one of "live", "test"
gatewayrequiredpathstring

Responses

StatusMeaningBody
200Received
401Signature rejected

Examples

Sandboxbash
curl -X POST "https://api.checkout.staging.povito.com/v1/callbacks/{mode}/{gateway}"

Health

GET /health#

getHealth · no auth

Liveness and the list of registered gateways (names only)

Responses

StatusMeaningBody
200OK
inline schema
FieldTypeNotes
statusrequiredstring
one of "ok"
versionrequiredstring
gatewaysrequiredarray of string

Examples

Sandboxbash
curl "https://api.checkout.staging.povito.com/v1/health"

Shared parameters#

IdempotencyKey#

NameInTypeNotes
Idempotency-KeyrequiredheaderstringSame key + same body replays the first response; same key + different body is 409. A UUID is the usual choice
pattern ^[A-Za-z0-9_-]{8,128}$

SessionId#

NameInTypeNotes
idrequiredpathstring
pattern ^cs_(live|test)_[A-Za-z0-9]+$

SessionCode#

NameInTypeNotes
coderequiredpathstring
pattern ^[A-Z0-9]{8,32}$

Limit#

NameInTypeNotes
limitqueryinteger
default 20 · min 1 · max 100

Cursor#

NameInTypeNotes
cursorquerystring

Response headers#

IdempotentReplayed#

boolean — Present and true when this response was replayed from the idempotency store

Error responses#

NameMeaningBody
BadRequestValidation errorErrorEnvelope
UnauthorizedMissing or invalid keyErrorEnvelope
ForbiddenInsufficient scope, mode mismatch, or suspended merchantErrorEnvelope
NotFoundNot found (also returned for another merchant's objects)ErrorEnvelope
ConflictIdempotency conflict, wrong state, or refund ceilingErrorEnvelope
UnprocessableBusiness ruleErrorEnvelope
RateLimitedToo many requests
header Retry-After
ErrorEnvelope

Schemas#

ErrorEnvelope#

FieldTypeNotes
errorrequiredobject
fields
FieldTypeNotes
coderequiredstring
one of "validation_error", "idempotency_key_required", "amount_mismatch", "unsupported_currency", "invalid_api_key", "invalid_publishable_key", "insufficient_scope", "mode_mismatch", "merchant_suspended", "session_not_found", "attempt_not_found", "refund_not_found", "endpoint_not_found", "event_not_found", "idempotency_key_conflict", "session_not_open", "session_canceled", "attempt_in_progress", "refund_exceeds_captured", "method_not_enabled", "method_not_available", "method_not_refundable", "return_host_not_allowed", "expiry_out_of_range", "session_expired", "phone_not_verified", "otp_invalid", "otp_expired", "otp_locked", "forbidden", "rate_limited", "gateway_error", "gateway_not_configured", "internal_error"
messagerequiredstring
detailsarray of object
fields
FieldTypeNotes
fieldrequiredstring
issuerequiredstring
request_idrequiredstring

Currency#

ISO 4217. Amounts are minor units per TRANSACTED_EXPONENT (IQD = whole dinars, USD = cents)

string — ISO 4217. Amounts are minor units per TRANSACTED_EXPONENT (IQD = whole dinars, USD = cents)
pattern ^[A-Z]{3}$

MinorUnits#

Integer minor units of the stated currency

integer — Integer minor units of the stated currency
min 0

PhoneE164#

string
pattern ^\+[1-9][0-9]{6,14}$ · e.g. "+9647800000000"

Locale#

string
one of "ar", "ku", "en"

MethodCode#

PAYMENT_METHOD_CODES from povito-contracts plus card, apple_pay, google_pay, test

string — PAYMENT_METHOD_CODES from povito-contracts plus card, apple_pay, google_pay, test
one of "cashondelivery", "fib", "fib_card", "zaincash", "qicard", "fastpay", "nasspay", "asiapay", "stripe", "card", "apple_pay", "google_pay", "test"

SessionStatus#

string
one of "open", "processing", "completed", "expired", "canceled"

PaymentStatus#

string
one of "unpaid", "paid", "requires_offline_collection", "failed", "partially_refunded", "refunded"

AttemptStatus#

string
one of "created", "initiated", "redirected", "presented", "charging", "verifying", "succeeded", "failed", "canceled", "expired"

LineItem#

FieldTypeNotes
labelrequiredstring
max length 200
amountrequiredMinorUnits
quantityinteger
default 1 · min 1
typerequiredstringcharge, shipping and fee add; discount subtracts; the net must equal the session amount
one of "charge", "shipping", "fee", "discount"

Address#

FieldTypeNotes
governoratestringIraqi governorate code (GovernorateCode in povito-contracts)
citystring
max length 120
linestring
max length 240
landmarkstring
max length 240
countrystring
default "IQ" · pattern ^[A-Z]{2}$
geoobject
fields
FieldTypeNotes
latnumber
lngnumber

CustomerInput#

FieldTypeNotes
phonePhoneE164
namestring
max length 120
addressAddress

Collect#

FieldTypeNotes
phonestring
one of "required", "optional", "none" · default "required"
namestring
one of "required", "optional", "none" · default "required"
shipping_addressstring
one of "required", "optional", "none" · default "none"

Presentment#

Only for methods that cannot present the session currency (Stripe presents USD). The rate is snapshotted and reported, never recomputed.

FieldTypeNotes
currencyrequiredCurrency
fx_raterequiredintegerMicro-units — 1_000_000 = 1.0; session currency per presentment currency
min 1

CheckoutSessionCreate#

FieldTypeNotes
reference_idrequiredstring
min length 1 · max length 128
amountrequiredMinorUnits
currencyrequiredCurrency
line_itemsrequiredarray of LineItem
at least 1 item
payment_method_typesarray of MethodCodeDefault is every enabled method for this merchant that supports the currency
customerCustomerInput
collectCollect
presentmentPresentment
localeLocale
success_urlrequiredstring (uri)Host must be on the merchant's allowed list; no status is appended
cancel_urlstring (uri)
expires_atstring (date-time)Default +60 min; min +5 min; max +24 h
metadatamap of string
at most 20 keys

PaymentDetails#

For cash on delivery (payment_status requires_offline_collection) captured_amount and captured_currency are null — no money moved

FieldTypeNotes
attempt_idrequiredstring
methodrequiredMethodCode
gatewayrequiredstring
gateway_referencerequiredstring
captured_amountrequiredinteger | null
min 0
captured_currencyrequiredstring | null
pattern ^[A-Z]{3}$
presented_amountrequiredMinorUnits
presented_currencyrequiredCurrency
fx_rateinteger | nullMicro-units
captured_atrequiredstring (date-time)
instrumentobject | null
fields
FieldTypeNotes
brandstring
last_fourstring
pattern ^[0-9]{4}$

CheckoutSession#

FieldTypeNotes
idrequiredstring
e.g. "cs_live_01J8Z3K9Q4M2XA7B"
objectrequiredstring
one of "checkout.session"
coderequiredstring
urlrequiredstring (uri)
livemoderequiredboolean
statusrequiredSessionStatus
payment_statusrequiredPaymentStatus
reference_idrequiredstring
amountrequiredMinorUnits
currencyrequiredCurrency
line_itemsrequiredarray of LineItem
payment_method_typesrequiredarray of MethodCode
customerrequiredobject
fields
FieldTypeNotes
idstring | null
phonestring | null
namestring | null
addressAddress or null
collectCollect
presentmentPresentment or null
paymentrequiredPaymentDetails or null
refunded_amountMinorUnits
localeLocale
success_urlrequiredstring (uri)
cancel_urlstring | null (uri)
expires_atrequiredstring (date-time)
completed_atstring | null (date-time)
metadatamap of string
created_atrequiredstring (date-time)
updated_atrequiredstring (date-time)

PaymentMethod#

FieldTypeNotes
coderequiredMethodCode
display_namerequiredobject
fields
FieldTypeNotes
arrequiredstring
kurequiredstring
enrequiredstring
flowrequiredstring
one of "redirect", "present", "charge", "offline"
currenciesrequiredarray of Currency
limitsmap of object
capabilitiesrequiredobject
fields
FieldTypeNotes
refundsrequiredstring
one of "none", "full", "partial"
saved_instrumentsrequiredboolean
walletsarray of string
enabledrequiredboolean

RefundCreate#

FieldTypeNotes
session_idrequiredstring
amountrequiredMinorUnits
reasonrequiredstring
min length 10 · max length 1500
metadatamap of string

Refund#

FieldTypeNotes
idrequiredstring
objectrequiredstring
one of "refund"
livemoderequiredboolean
session_idrequiredstring
attempt_idrequiredstring
amountrequiredMinorUnits
currencyrequiredCurrency
reasonrequiredstring
initiated_byrequiredstring
one of "merchant", "povito_admin"
statusrequiredstring
one of "requested", "processing", "succeeded", "failed", "rejected"
gateway_referencestring | null
failure_reasonstring | null
metadatamap of string
created_atrequiredstring (date-time)
updated_atstring (date-time)

EventType#

string
one of "*", "checkout.session.completed", "checkout.session.expired", "checkout.session.canceled", "payment.attempt.failed", "refund.succeeded", "refund.failed", "customer.instrument.saved", "customer.instrument.revoked"

WebhookEndpointCreate#

FieldTypeNotes
urlrequiredstring (uri)HTTPS only; private-network targets are refused
eventsrequiredarray of EventType
at least 1 item
moderequiredstring
one of "live", "test"
descriptionstring
max length 200

WebhookEndpoint#

FieldTypeNotes
idrequiredstring
objectrequiredstring
one of "webhook_endpoint"
urlrequiredstring (uri)
eventsrequiredarray of EventType
moderequiredstring
one of "live", "test"
statusrequiredstring
one of "enabled", "disabled"
disabled_reasonstring | null
one of "delivery_failures", "merchant", null
descriptionstring | null
created_atrequiredstring (date-time)

WebhookEndpointWithSecret#

All fields of WebhookEndpoint, plus:

FieldTypeNotes
idrequiredstring
objectrequiredstring
one of "webhook_endpoint"
urlrequiredstring (uri)
eventsrequiredarray of EventType
moderequiredstring
one of "live", "test"
statusrequiredstring
one of "enabled", "disabled"
disabled_reasonstring | null
one of "delivery_failures", "merchant", null
descriptionstring | null
created_atrequiredstring (date-time)
secretrequiredstringShown once. Verify Povito-Signature with it

Event#

FieldTypeNotes
idrequiredstring
objectrequiredstring
one of "event"
typerequiredEventType
livemoderequiredboolean
created_atrequiredstring (date-time)
datarequiredobject
fields
FieldTypeNotes
objectrequiredCheckoutSession or Refund or Instrumentcheckout.session.* and payment.attempt.failed carry a CheckoutSession (the latter with an extra failed_attempt object); refund.* a Refund; customer.instrument.* an Instrument

EventWithDeliveries#

All fields of Event, plus:

FieldTypeNotes
idrequiredstring
objectrequiredstring
one of "event"
typerequiredEventType
livemoderequiredboolean
created_atrequiredstring (date-time)
datarequiredobject
fields
FieldTypeNotes
objectrequiredCheckoutSession or Refund or Instrumentcheckout.session.* and payment.attempt.failed carry a CheckoutSession (the latter with an extra failed_attempt object); refund.* a Refund; customer.instrument.* an Instrument
deliveriesarray of object
fields
FieldTypeNotes
endpoint_idstring
attempt_nointeger
status_codeinteger | null
errorstring | nullhttp_<status>, timeout, a network error, or endpoint_deleted for an attempt cancelled because its endpoint was deleted
delivered_atstring | null (date-time)
next_retry_atstring | null (date-time)

Instrument#

FieldTypeNotes
idrequiredstring
objectrequiredstring
one of "instrument"
gatewayrequiredstring
brandstring | null
last_fourstring | null
expirystring | null
pattern ^[0-9]{2}/[0-9]{2}$
statusrequiredstring
one of "active", "canceled"

PublicCustomerProfile#

FieldTypeNotes
namestring | null
addressesarray of Address
instrumentsarray of Instrument

PublicSession#

What the page may see — never metadata, never other sessions

FieldTypeNotes
coderequiredstring
statusrequiredSessionStatus
payment_statusrequiredPaymentStatus
reference_idstring
amountrequiredMinorUnits
currencyrequiredCurrency
line_itemsrequiredarray of LineItem
merchantrequiredobject
fields
FieldTypeNotes
display_namerequiredstring
logo_urlstring | null (uri)
accentstring | nullContrast-checked at save time
pattern ^#[0-9a-fA-F]{6}$
methodsrequiredarray of PaymentMethod + object
customerobject
fields
FieldTypeNotes
phonestring | null
phone_verifiedboolean
namestring | null
addressAddress or null
collectrequiredCollect
localerequiredLocale
expires_atrequiredstring (date-time)
cancel_urlstring | null (uri)
livemoderequiredboolean
profilerequiredPublicCustomerProfile or nullThe saved profile when a still-valid X-Povito-Customer-Token accompanies the read; null otherwise

AttemptPoll#

FieldTypeNotes
attempt_idrequiredstring
coderequiredstring
methodrequiredMethodCode
statusrequiredAttemptStatus
session_statusrequiredSessionStatus
payment_statusrequiredPaymentStatus
redirect_torequiredstring | null (uri)success_url with session_id and reference_id appended once the session completed; never a status
failure_reasonrequiredstring | null
presentrequiredobject | nullRe-shown on reload for present flows (FIB QR). qr_code is a data URI image.
fields
FieldTypeNotes
qr_codestring
readable_codestring
personal_app_linkstring (uri)
business_app_linkstring (uri)
valid_untilstring (date-time)
cancel_urlrequiredstring | null (uri)

AttemptStart#

FieldTypeNotes
attempt_idrequiredstring
kindrequiredstring
one of "redirect", "present", "processing", "offline"
redirect_urlstring | null (uri)
form_postmap of string | nullWhen present the page must auto-submit an HTML form POST of exactly these fields to redirect_url instead of navigating (NassPay)
presentobject | null
fields
FieldTypeNotes
qr_codestring
readable_codestring
personal_app_linkstring (uri)
business_app_linkstring (uri)
valid_untilstring (date-time)

Examples#

CreateMarketplaceSession#

Marketplace order, method pre-selected in the storefront (Phase 1)

json
{
  "reference_id": "cart_01J8Z3K9Q4M2XA7B",
  "amount": 45000,
  "currency": "IQD",
  "line_items": [
    {
      "label": "Basket",
      "amount": 42000,
      "type": "charge"
    },
    {
      "label": "Delivery — Hi-Express",
      "amount": 5000,
      "type": "shipping"
    },
    {
      "label": "Coupon RAMADAN",
      "amount": 2000,
      "type": "discount"
    }
  ],
  "payment_method_types": [
    "zaincash"
  ],
  "customer": {
    "phone": "+9647800000000",
    "name": "Ali M. Ismail"
  },
  "collect": {
    "phone": "required",
    "name": "required",
    "shipping_address": "none"
  },
  "locale": "ar",
  "success_url": "https://povito.com/ar/checkout/payment/return",
  "cancel_url": "https://povito.com/ar/checkout",
  "metadata": {
    "cart_id": "cart_01J8Z3K9Q4M2XA7B"
  }
}

Povito extensions#

Values from x-povito in the contract — the webhook signing shape and retry schedule the webhooks guide documents.

json
{
  "decisions": [
    "D-44",
    "D-45",
    "D-46",
    "D-47",
    "D-48",
    "D-49",
    "D-50",
    "D-51"
  ],
  "webhook_signature": {
    "header": "Povito-Signature",
    "format": "t=<unix>,v1=<hex>",
    "algorithm": "HMAC-SHA256(secret, `${t}.${rawBody}`)",
    "tolerance_seconds": 300,
    "retry_schedule": [
      60,
      300,
      1800,
      7200,
      21600,
      86400,
      86400
    ]
  }
}