PeptidesPayment Docs
Payment ContainerPayments

Charge a card for a cart

POST/payments/charge

Charges the buyer's card for a cart using a secure card reference collected by the checkout form, together with the billing details and the cart id. PeptidesPayment loads the cart, selects a payment route, and retries automatically on a soft decline.

Declined payments (a hard failure, a soft failure, or a pending result) return HTTP 200 with a status field describing the outcome. Only validation or configuration errors return a non-2xx response.

Authorization

ApiKeyAuth
x-api-key<token>

Your API key, issued by PeptidesPayment. Send it in the x-api-key header. Keep it server-side and never expose it in browser code.

In: header

Header Parameters

x-merchant-id*string

Your merchant id, supplied by PeptidesPayment at integration time.

Request Body

application/json

Request body

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

curl -X POST "https://example.com/payments/charge" \  -H "x-merchant-id: string" \  -H "Content-Type: application/json" \  -d '{    "cart_id": "string",    "merchant_id": "string",    "payment_method": "string"  }'
{  "status": "success",  "psp_reference": "string",  "redirect_url": "string",  "customer_message": "string",  "threeds_session_id": "string",  "acs_transaction_id": "string",  "threeds_version": "string",  "native_threeds_challenge": {    "acs_url": "string",    "creq": "string",    "acs_transaction_id": "string",    "threeds_server_transaction_id": "string",    "threeds_version": "string",    "challenge_response_url": "string"  }}

Create a cart from a WooCommerce cart token POST

Creates a cart from a WooCommerce Store API cart token.

Get the sales-tax / VAT rate for a ship-to address POST

Returns the **tax rate** (a fraction, e.g. `0.07` = 7%) for a ship-to address, computed with our own engine - the same combined state + county + city + district rate (statutory VAT outside the US) that the post-payment verifier uses. **How to use it** 1. Send the buyer's `shipping_address` (address only - no items or amounts). 2. We return `tax_rate`. 3. Compute `tax = round(tax_rate × taxable_base)`, where the base is the items subtotal (net of discounts) **+** shipping, only where the destination taxes freight. 4. Display the computed tax to the buyer as its own labeled line item (for example "Tax" or "VAT") in the checkout totals before payment - do not fold it silently into the grand total. The buyer must be able to see the amount they are being charged as tax. 5. Charge the buyer, then send that same tax back on the order in `merchant_supplied_totals.tax_cents`. Because the quote and the post-payment verification run the **same engine**, charging this number means **no tax-shortfall correction** is applied to your payout. A tax-free destination returns `tax_rate: 0` - collect no tax. `override_enabled` tells you whether PeptidesPayment expects to apply this tax for you: `false` means your store is configured to compute its own tax, so leave your own tax in place and ignore `tax_rate`. It is `true` for every other store (including tax-free destinations, where `tax_rate` is `0`).