Skip to main content
Version: 0.1.0

Customer Payments API

REST contract of the customer-payments bounded context of the digital storefront, as the service serves it. Customer Payments moves money with the shipment facts: authorize at checkout, capture each shipment group's allocation when it ships (FulfillmentShipped), release on cancellation (FulfillmentCancelled), refund on lost or returned packages (PackageLost, PackageReturned), and re-authorize uncaptured allocations before the provider's authorization validity expires. The provider is reached through an ACL port (Authorize, Capture, Void, Refund, Reauthorize) with deterministic idempotency keys per (operation, authorizationId, groupNo); the storefront never sees a card number, only PSP tokens. This surface is called by checkout (authorize, void) and by storefront ops (refunds, reads); captures, releases and re-authorizations arrive as Kafka events or policies, never as REST writes. Errors are RFC 9457 problem details (application/problem+json) whose type is /problems/<slug>; shared types are not-found (404), illegal-transition (409), concurrent-update (409) and validation-failed (422), plus one kebab-case slug per Err of the model, and the idempotency problems idempotency-key-required and idempotency-key-invalid (400) and idempotency-key-reused (409). Every write (each POST) takes an Idempotency-Key header: a retry with the same key and the same request (method, path, body) replays the first answer (Idempotency-Replayed: true). A 2xx is stored for 24 hours, and so is a refusal that is final for the request (malformed-request, allocation-mismatch, negative-amount); a refusal that depends on state that can change (not-found, concurrent-update, illegal-transition, over-refund, payment-declined, validation-failed) and a 5xx are never stored: the key is released, the same Idempotency-Key runs the request again, and another request under it is a new request, not idempotency-key-reused. Otherwise the same key with another request is 409 idempotency-key-reused. A body that is not one JSON object of the declared fields (unknown field, trailing data, over 64 KiB, a NUL character) is 400 malformed-request; a NUL character in a path is 404 resource-not-found. Any operation can answer 500 internal-error. The two collection reads are keyset-paged ({items, nextCursor}; invalid-limit, invalid-cursor and unknown-query-parameter are 400). No authentication.

Contact

customer-payments maintainers:

URL: https://github.com/IQVO/customer-payments