Skip to main content
Skip to Content
Cresora Commerce

H P P

Hosted Payment Pages — Cresora-hosted checkout. PCI scope stays with Cresora + the gateway. The partner only handles the session redirect and the callback on completion.

ℹServer-to-server API
Run the examples on this page from your backend against the sandbox host. The API sends no CORS headers, so browser JavaScript cannot read its responses, and an API key must never be exposed in a browser. There is no interactive console here. Generating a client instead? Download the OpenAPI spec (YAML).
ℹThe reference can be ahead of the sandbox
It is generated from the latest version of the API contract, so an operation, field or error code listed here may not be available on the sandbox yet.

Create HPP session

POST/hpp/sessions

Authorization

BearerAuth
AuthorizationBearer <token>

Cresora API key, sent as an opaque bearer token in the Authorization header. Format:

csk_<prefix>_<random>
  • <prefix> — 8 URL-safe chars, shown in UI and logs for identification without revealing the full key (e.g. csk_Ab3kX9mQ…). Use ApiKey.prefix to match.
  • <random> — 24+ cryptographically random URL-safe chars.

Obtain via Partner Portal → Settings → API keys. Keys are only shown in full at creation/rotation time — Cresora does not retain the full value in retrievable form. Rotate any key that may have been exposed via logs, client code, or source control.

In: header

Header Parameters

Idempotency-Key*string

Client-generated unique key — a UUIDv4 is the recommended form. Cresora deduplicates within a 24-hour window scoped to the partner. On an admin console operation the 24-hour response cache is scoped to the operator instead; an operation that also records the key with the resource it creates or changes answers that key from that record, whichever operator sends it.

Format: 1–128 characters of letters, digits, . _ : -. On every write, a key over 128 characters is rejected with 400 idempotency_key_too_long and a blank or missing key with 400 idempotency_key_required. A character outside that set is rejected with 400 validation_error by the endpoints that record or forward the key, such as transaction creates. The character set is narrower than base64: padded base64 (+ / =) is NOT accepted, base64url is. The key is forwarded verbatim to the payment gateway on transaction creates, so it must satisfy the gateway's key contract too — rejecting locally gives you an actionable error instead of an opaque upstream failure mid-request.

Reserved prefixes — rejected with 400 idempotency_key_reserved:

  • hpp:, hpp-contract:, recurring: — Cresora's own server-minted deterministic keys, rejected on any write. A client key in these namespaces could collide with a platform-generated record.
  • rb:, inv-charge:, inv-installment: — reserved by the payment gateway for its internally-minted keys, rejected on the transaction creates, which forward the key to the gateway, and on some other writes.

Replay semantics:

  • Same key + same request body → Cresora returns the cached response from the original call. Response includes header X-Idempotent-Replay: true so the client can distinguish replays from fresh executions. Status code, body and side effects are identical to the original call.
  • Same key + different body → 422 idempotency_key_reused. Generate a new key and retry, or re-send the original body.
  • Key older than 24 hours → the response cache has expired. On a create that persists the key, the created resource still answers for as long as it exists: the same request replays it, a different one answers 422 idempotency_key_reused. POST /transactions is such a create: it replays from the transaction it recorded under the key, matched on key and partner_id, which does not expire. (3-D Secure completion answers a repeat from the transaction's current state instead.) Elsewhere the key is treated as fresh.

After an indeterminate outcome. 502 gateway_outcome_unknown means the outcome is unknown, not that the request failed: it may have been processed. It is always retryable: false — never resend it automatically, and never under a fresh key (a fresh key risks a double charge or a double refund).

  • Body carries replay: "same_idempotency_key" — Cresora recorded the attempt as pending (state: INITIATED) and reconciles it automatically. Resend the identical request with the SAME key to obtain the transaction: it is not sent to the gateway again, and the answer is 200 with the transaction in its state at that moment, never a second charge. Then GET /transactions/{transactionId} for its final state. That 200 is cached for 24 hours, so a further same-key resend returns the same snapshot, not necessarily the final state. This is also what an ACH_DEBIT / ACH_REFUND gets when the gateway answers a result code Cresora does not recognise (for example one the gateway added later), or none. A card sale, refund or partial refund answered Submit / Pend, an unrecognised result code or none gets it too, but only while the card park flag is on, which it is in no environment.
  • No replay member — Cresora does not promise that a resend is safe. Do not resend automatically, never under a new key, and if the outcome cannot be established contact support quoting the error_id. The core service answers this way on ACH_VOID, ACH_REVERSAL and CAPTURE_ALL on POST /transactions, 3-D Secure completion, POST /merchants/{merchantId}/customers and POST /contracts, whose detail says the outcome of the attempt was not recorded (a resend may repeat it). Cresora's edge answers this way for any POST, PUT or PATCH under this API whose call to its core service failed in any way that does not prove it never left (a timeout or a lost connection included), or when the load balancer in front of the core service answered a 5xx itself, even when the core service went on to record the transaction.

Gateway faults on writes Cresora does not record. ACH_VOID, ACH_REVERSAL and CAPTURE_ALL on POST /transactions, 3-D Secure completion, POST /merchants/{merchantId}/customers and POST /contracts send the gateway a call that a resend may repeat, and no Cresora row records the attempt. Any fault after that call may have been sent answers 502 gateway_outcome_unknown, retryable: false, without replay: a timeout or a lost connection, a gateway 5xx, or a reply Cresora cannot read (an unparseable 2xx, a 3xx, since redirects are not followed, or a non-JSON body such as a maintenance page). Its detail says the outcome of the attempt was not recorded. One exception, on the POST /transactions types and 3-D Secure completion: a reply carrying the gateway's create-dedup-store-unavailable error code answers the retryable gateway_unavailable whatever its HTTP status, a 5xx included. A fault that proves the call was never sent (such as an open circuit, a full concurrency limit, a refused connection, an unresolvable host, a connect timeout, a failed TLS handshake) keeps its retryable gateway_circuit_open, gateway_unavailable or gateway_timeout, and a resend under the same key is safe. A gateway 4xx refusal keeps its own code, except a 408: the gateway stopped waiting on a request it may have applied, so it answers gateway_outcome_unknown too. On POST /contracts this is the create call: a fault in the activation call that follows a recorded create keeps its retryable code, and a resend under the same key resumes that contract. The hosted-page configuration writes and the admin gateway-provisioning writes describe their own gateway_outcome_unknown under their 502. On any write, resend after a retryable code only under the same key, never a new one, with one exception: retry an hpp_url_missing under a NEW key, since the same key may return the first session again.

Cresora's edge session-auth routes (/api/auth/*) and webhook ingress (/api/v1/webhooks/*) answer their own gateway_unavailable, retryable: true, when their call to the core service fails, sent or not, and when the load balancer in front of the core service answered a 5xx itself. In both cases POST /api/auth/magic-link and POST /api/auth/logout answer 204 instead. Every 204 from POST /api/auth/magic-link carries Retry-After: the configured sign-in cooldown length in seconds, the same value whatever the address or the outcome, so a client can wait it out before asking again. The gateway_unavailable answer is retryable by design. No auth call moves money, though a resend can count a failed password or TOTP check twice toward the lockout. The core service deduplicates WinkPG webhook events on (provider, event_id) and DocuSign Connect events on their event reference, and records no Salesforce event yet, so a redelivery is safe. See createTransaction.

Do NOT reuse keys across different partners. Scope is enforced per partner_id so the same key in partner A and partner B is independent.

Match^[A-Za-z0-9._:\-]+$
Length1 <= length <= 128

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

curl -X POST "https://example.com/hpp/sessions" \  -H "Idempotency-Key: string" \  -H "Content-Type: application/json" \  -d '{    "merchant_id": "500924a8-3f5e-4c00-beb8-2efcde988aea"  }'
{  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "merchant_id": "500924a8-3f5e-4c00-beb8-2efcde988aea",  "payment_method": "card",  "state": "PENDING",  "hpp_url": "http://example.com",  "iframe_url": "http://example.com",  "rendering_mode": "redirect",  "capture_mode": "sale",  "amount_mode": "customer_entered",  "minimum_amount": "string",  "maximum_amount": "string",  "page_purpose": "payment",  "recurring_plan": {    "recurring_amount": "string",    "frequency": "daily",    "interval": 1,    "number_of_payments": 2,    "initial_charge_amount": "string",    "management_url": "http://example.com"  },  "customer_id": "160c0c4b-9966-4dc1-a916-8407eb10d74e",  "amount": "string",  "surcharge_amount": "string",  "convenience_fee_amount": "string",  "total_amount": "string",  "currency": "USD",  "expires_at": "2019-08-24T14:15:22Z",  "created_at": "2019-08-24T14:15:22Z"}

Get HPP session status

GET/hpp/sessions/{sessionId}

Authorization

BearerAuth
AuthorizationBearer <token>

Cresora API key, sent as an opaque bearer token in the Authorization header. Format:

csk_<prefix>_<random>
  • <prefix> — 8 URL-safe chars, shown in UI and logs for identification without revealing the full key (e.g. csk_Ab3kX9mQ…). Use ApiKey.prefix to match.
  • <random> — 24+ cryptographically random URL-safe chars.

Obtain via Partner Portal → Settings → API keys. Keys are only shown in full at creation/rotation time — Cresora does not retain the full value in retrievable form. Rotate any key that may have been exposed via logs, client code, or source control.

In: header

Path Parameters

sessionId*string
Formatuuid

Response Body

application/json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

curl -X GET "https://example.com/hpp/sessions/497f6eca-6276-4993-bfeb-53cbbbba6f08"
{  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "state": "PENDING",  "payment_method": "card",  "capture_mode": "sale",  "amount_mode": "customer_entered",  "minimum_amount": "string",  "maximum_amount": "string",  "page_purpose": "payment",  "recurring_plan": {    "recurring_amount": "string",    "frequency": "daily",    "interval": 1,    "number_of_payments": 2,    "initial_charge_amount": "string",    "management_url": "http://example.com"  },  "customer_id": "160c0c4b-9966-4dc1-a916-8407eb10d74e",  "tokenization_outcome": "not_requested",  "vault_token": "string",  "transaction_id": "0fec1e58-b197-4052-99cf-2218496c5482",  "completed_at": "2019-08-24T14:15:22Z",  "expires_at": "2019-08-24T14:15:22Z",  "rendering_mode": "redirect",  "last_attempt": {    "at": "2019-08-24T14:15:22Z",    "reason": "reversed"  },  "card": {    "last4": "string",    "expiry_month": 1,    "expiry_year": 0,    "brand": "string"  },  "bank": {    "account_type": "CHECKING",    "account_last4": "string",    "routing_last4": "string"  },  "token_capture_failure": {    "at": "2019-08-24T14:15:22Z",    "reason": "string"  },  "level3_data": {    "ship_from_zip": "string",    "destination_zip": "string",    "destination_country_code": "string",    "invoice_number": "string",    "order_number": "string",    "duty_amount": "string",    "freight_amount": "string",    "discount_amount": "string",    "line_items": [      {        "product_code": "string",        "commodity_code": "string",        "description": "string",        "upc": "string",        "invoice_number": "string",        "tax_type": "string",        "quantity": "string",        "unit_of_measure": "string",        "unit_price": "string",        "discount_amount": "string",        "total_amount": "string",        "tax_amount": "string",        "tax_rate": "string",        "extended_amount": "string",        "freight_amount": "string",        "duty_amount": "string",        "tax_included": true      }    ]  }}

Cancel HPP session

POST/hpp/sessions/{sessionId}/cancel

Authorization

BearerAuth
AuthorizationBearer <token>

Cresora API key, sent as an opaque bearer token in the Authorization header. Format:

csk_<prefix>_<random>
  • <prefix> — 8 URL-safe chars, shown in UI and logs for identification without revealing the full key (e.g. csk_Ab3kX9mQ…). Use ApiKey.prefix to match.
  • <random> — 24+ cryptographically random URL-safe chars.

Obtain via Partner Portal → Settings → API keys. Keys are only shown in full at creation/rotation time — Cresora does not retain the full value in retrievable form. Rotate any key that may have been exposed via logs, client code, or source control.

In: header

Path Parameters

sessionId*string
Formatuuid

Header Parameters

Idempotency-Key*string

Client-generated unique key — a UUIDv4 is the recommended form. Cresora deduplicates within a 24-hour window scoped to the partner. On an admin console operation the 24-hour response cache is scoped to the operator instead; an operation that also records the key with the resource it creates or changes answers that key from that record, whichever operator sends it.

Format: 1–128 characters of letters, digits, . _ : -. On every write, a key over 128 characters is rejected with 400 idempotency_key_too_long and a blank or missing key with 400 idempotency_key_required. A character outside that set is rejected with 400 validation_error by the endpoints that record or forward the key, such as transaction creates. The character set is narrower than base64: padded base64 (+ / =) is NOT accepted, base64url is. The key is forwarded verbatim to the payment gateway on transaction creates, so it must satisfy the gateway's key contract too — rejecting locally gives you an actionable error instead of an opaque upstream failure mid-request.

Reserved prefixes — rejected with 400 idempotency_key_reserved:

  • hpp:, hpp-contract:, recurring: — Cresora's own server-minted deterministic keys, rejected on any write. A client key in these namespaces could collide with a platform-generated record.
  • rb:, inv-charge:, inv-installment: — reserved by the payment gateway for its internally-minted keys, rejected on the transaction creates, which forward the key to the gateway, and on some other writes.

Replay semantics:

  • Same key + same request body → Cresora returns the cached response from the original call. Response includes header X-Idempotent-Replay: true so the client can distinguish replays from fresh executions. Status code, body and side effects are identical to the original call.
  • Same key + different body → 422 idempotency_key_reused. Generate a new key and retry, or re-send the original body.
  • Key older than 24 hours → the response cache has expired. On a create that persists the key, the created resource still answers for as long as it exists: the same request replays it, a different one answers 422 idempotency_key_reused. POST /transactions is such a create: it replays from the transaction it recorded under the key, matched on key and partner_id, which does not expire. (3-D Secure completion answers a repeat from the transaction's current state instead.) Elsewhere the key is treated as fresh.

After an indeterminate outcome. 502 gateway_outcome_unknown means the outcome is unknown, not that the request failed: it may have been processed. It is always retryable: false — never resend it automatically, and never under a fresh key (a fresh key risks a double charge or a double refund).

  • Body carries replay: "same_idempotency_key" — Cresora recorded the attempt as pending (state: INITIATED) and reconciles it automatically. Resend the identical request with the SAME key to obtain the transaction: it is not sent to the gateway again, and the answer is 200 with the transaction in its state at that moment, never a second charge. Then GET /transactions/{transactionId} for its final state. That 200 is cached for 24 hours, so a further same-key resend returns the same snapshot, not necessarily the final state. This is also what an ACH_DEBIT / ACH_REFUND gets when the gateway answers a result code Cresora does not recognise (for example one the gateway added later), or none. A card sale, refund or partial refund answered Submit / Pend, an unrecognised result code or none gets it too, but only while the card park flag is on, which it is in no environment.
  • No replay member — Cresora does not promise that a resend is safe. Do not resend automatically, never under a new key, and if the outcome cannot be established contact support quoting the error_id. The core service answers this way on ACH_VOID, ACH_REVERSAL and CAPTURE_ALL on POST /transactions, 3-D Secure completion, POST /merchants/{merchantId}/customers and POST /contracts, whose detail says the outcome of the attempt was not recorded (a resend may repeat it). Cresora's edge answers this way for any POST, PUT or PATCH under this API whose call to its core service failed in any way that does not prove it never left (a timeout or a lost connection included), or when the load balancer in front of the core service answered a 5xx itself, even when the core service went on to record the transaction.

Gateway faults on writes Cresora does not record. ACH_VOID, ACH_REVERSAL and CAPTURE_ALL on POST /transactions, 3-D Secure completion, POST /merchants/{merchantId}/customers and POST /contracts send the gateway a call that a resend may repeat, and no Cresora row records the attempt. Any fault after that call may have been sent answers 502 gateway_outcome_unknown, retryable: false, without replay: a timeout or a lost connection, a gateway 5xx, or a reply Cresora cannot read (an unparseable 2xx, a 3xx, since redirects are not followed, or a non-JSON body such as a maintenance page). Its detail says the outcome of the attempt was not recorded. One exception, on the POST /transactions types and 3-D Secure completion: a reply carrying the gateway's create-dedup-store-unavailable error code answers the retryable gateway_unavailable whatever its HTTP status, a 5xx included. A fault that proves the call was never sent (such as an open circuit, a full concurrency limit, a refused connection, an unresolvable host, a connect timeout, a failed TLS handshake) keeps its retryable gateway_circuit_open, gateway_unavailable or gateway_timeout, and a resend under the same key is safe. A gateway 4xx refusal keeps its own code, except a 408: the gateway stopped waiting on a request it may have applied, so it answers gateway_outcome_unknown too. On POST /contracts this is the create call: a fault in the activation call that follows a recorded create keeps its retryable code, and a resend under the same key resumes that contract. The hosted-page configuration writes and the admin gateway-provisioning writes describe their own gateway_outcome_unknown under their 502. On any write, resend after a retryable code only under the same key, never a new one, with one exception: retry an hpp_url_missing under a NEW key, since the same key may return the first session again.

Cresora's edge session-auth routes (/api/auth/*) and webhook ingress (/api/v1/webhooks/*) answer their own gateway_unavailable, retryable: true, when their call to the core service fails, sent or not, and when the load balancer in front of the core service answered a 5xx itself. In both cases POST /api/auth/magic-link and POST /api/auth/logout answer 204 instead. Every 204 from POST /api/auth/magic-link carries Retry-After: the configured sign-in cooldown length in seconds, the same value whatever the address or the outcome, so a client can wait it out before asking again. The gateway_unavailable answer is retryable by design. No auth call moves money, though a resend can count a failed password or TOTP check twice toward the lockout. The core service deduplicates WinkPG webhook events on (provider, event_id) and DocuSign Connect events on their event reference, and records no Salesforce event yet, so a redelivery is safe. See createTransaction.

Do NOT reuse keys across different partners. Scope is enforced per partner_id so the same key in partner A and partner B is independent.

Match^[A-Za-z0-9._:\-]+$
Length1 <= length <= 128

Response Body

application/json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

curl -X POST "https://example.com/hpp/sessions/497f6eca-6276-4993-bfeb-53cbbbba6f08/cancel" \  -H "Idempotency-Key: string"
{  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "state": "PENDING",  "payment_method": "card",  "capture_mode": "sale",  "amount_mode": "customer_entered",  "minimum_amount": "string",  "maximum_amount": "string",  "page_purpose": "payment",  "recurring_plan": {    "recurring_amount": "string",    "frequency": "daily",    "interval": 1,    "number_of_payments": 2,    "initial_charge_amount": "string",    "management_url": "http://example.com"  },  "customer_id": "160c0c4b-9966-4dc1-a916-8407eb10d74e",  "tokenization_outcome": "not_requested",  "vault_token": "string",  "transaction_id": "0fec1e58-b197-4052-99cf-2218496c5482",  "completed_at": "2019-08-24T14:15:22Z",  "expires_at": "2019-08-24T14:15:22Z",  "rendering_mode": "redirect",  "last_attempt": {    "at": "2019-08-24T14:15:22Z",    "reason": "reversed"  },  "card": {    "last4": "string",    "expiry_month": 1,    "expiry_year": 0,    "brand": "string"  },  "bank": {    "account_type": "CHECKING",    "account_last4": "string",    "routing_last4": "string"  },  "token_capture_failure": {    "at": "2019-08-24T14:15:22Z",    "reason": "string"  },  "level3_data": {    "ship_from_zip": "string",    "destination_zip": "string",    "destination_country_code": "string",    "invoice_number": "string",    "order_number": "string",    "duty_amount": "string",    "freight_amount": "string",    "discount_amount": "string",    "line_items": [      {        "product_code": "string",        "commodity_code": "string",        "description": "string",        "upc": "string",        "invoice_number": "string",        "tax_type": "string",        "quantity": "string",        "unit_of_measure": "string",        "unit_price": "string",        "discount_amount": "string",        "total_amount": "string",        "tax_amount": "string",        "tax_rate": "string",        "extended_amount": "string",        "freight_amount": "string",        "duty_amount": "string",        "tax_included": true      }    ]  }}