Confirm a loyalty-points contribution
Confirms a contribution using the Partner’s configured method. Loyalty Partners
send points after deducting loyalty points. Direct Partners send amount_halalas
and partner_payment_reference after collecting payment on their own infrastructure.
Do not send the method on the request, and do not send card or PSP credentials.
Identities
Idempotency-Keyis required. The same key and payload returns the original result. A conflicting payload returnsidempotency_conflict.partner_event_idis the contribution uniqueness and recovery key.partner_order_refallows one confirmed contribution per partner, environment, and order.- Direct
partner_payment_referencemust be unique per Partner and environment. calculation_idis optional and only when Delivery Emissions is enabled. A missing or invalid value must not fail an otherwise valid contribution.
Validation
- Loyalty
pointsmust be a positive whole number (minimum1). Invalid shape returnsinvalid_point_amountand does not persist a contribution. - Direct
amount_halalasis an integer number of Halalas, minimum100(1 SAR), and must not exceed the Partner maximum or platform ceiling. Invalid shape or range returnsinvalid_direct_amountand does not persist a contribution. - Fields for the other method return
invalid_requestand do not persist a contribution. - A duplicate
partner_payment_referencereturnspayment_reference_conflict.
Statuses
pendingis exceptional and non-final.confirmedandfailedare terminal and do not interchange.- A confirmed contribution is non-refundable through this API.
- Do not reverse customer value (loyalty points or collected payment) for
pending, timeout, unknown result, orcontribution_not_found. Reverse value on your side only after terminalfailed. - Recover by
partner_event_id. Association failure is non-fatal: the contribution stays confirmed.
Authorizations
Canonical server-to-server API key header name: X-API-Key.
Partner customer applications must not use this credential.
Examples must never include raw API secrets.
Headers
Transport/request idempotency key required for delivery-emissions estimate creation,
contribution confirmation, and emissions-association creation.
Same key + same canonical payload returns the original result.
Same key + conflicting canonical payload returns idempotency_conflict.
Non-PII transport idempotency key.
8 - 128^[A-Za-z0-9._:-]+$"idem_01HZX5Z9Y8X7W6V5U4T3S2R1"
Optional request correlation header. If omitted, Akhdar generates one. Every success
and error response includes X-Correlation-ID. Error payloads include correlation_id.
Non-PII request correlation identifier.
8 - 128^[A-Za-z0-9._:-]+$"corr_7c2e9b1a4d6f8e0c"
Body
Method-discriminated contribution confirmation request. The Partner's configured contribution_method determines which fields are required: - loyalty_points: requires points; amount_halalas and partner_payment_reference
must be absent or null.
direct_contribution: requiresamount_halalasandpartner_payment_reference;pointsmust be absent or null. The API validates the request against the Partner's stored method and returns400 invalid_requestif required method-specific fields are missing or forbidden fields are present.
Stable contribution idempotency and recovery key supplied by the partner. Distinct from partner_order_ref.
8 - 128^[A-Za-z0-9._:-]+$"evt_contrib_01HZX5A1B2C3D4E5F6G7H8J9"
Stable non-PII partner order correlation reference. Enforces one confirmed contribution per partner order within partner and environment. Must not contain direct personal data.
1 - 128^[A-Za-z0-9._:-]+$"ord_9f3c2a71"
Loyalty points contributed. Required when Partner contribution_method is loyalty_points. Must be absent or null for direct_contribution Partners.
x >= 1500
Direct Contribution amount in Halalas. Required when Partner contribution_method is direct_contribution. Must be absent or null for loyalty_points Partners.
x >= 100500
Partner-supplied payment reference for Direct Contribution. Required when Partner contribution_method is direct_contribution. Must be unique within Partner and Environment. Must be absent or null for loyalty_points Partners.
1 - 128^[A-Za-z0-9._:-]+$"pay_ref_abc123xyz"
Optional Delivery Emissions estimate identifier for association. Only valid when Partner has delivery_emissions_enabled: true. Missing, invalid, or capability- disabled values must not invalidate an otherwise valid contribution.
8 - 128^[A-Za-z0-9._:-]+$"calc_01HZX4K9M2Q8R7N6P5T4V3W2X1"
Optional opaque partner-internal customer reference. Must not contain email, phone, full name, national identifier, or other direct personal data.
1 - 128^[A-Za-z0-9._:-]+$"cust_ref_8a1b2c3d"
Response
Idempotent replay returned the original contribution and association outcome.
Method-discriminated contribution record. Loyalty contributions include points and point_conversion_version. Direct contributions include amount_halalas and partner_payment_reference. monetary_value_halalas is the canonical amount in Halalas.
Closed association outcomes. associated includes link. rejected includes rejection.
not_requested includes neither.
- Option 1
- Option 2
- Option 3

