API reference

Create a payment

Create a hosted payment for a customer and receive a payment URL.

POSThttps://api.xxpayus.online/api/v1/payments/createAgent

Request body

FieldTypeDescription
methodstring, requiredPayment method id, e.g. cashapp, chime, googlepay, applepay, venmo, paypal
amountnumber, requiredAmount in USD. Must be one of the amounts enabled for the method on your account.
descriptionstring, optionalUp to 500 characters
cURL
curl -X POST https://api.xxpayus.online/api/v1/payments/create \
  -H "X-API-Key: xxp_pk_your_key_id" \
  -H "X-API-Secret: $XXPAYUS_API_SECRET" \
  -H "Content-Type: application/json" \
  -d '{"method":"cashapp","amount":50,"description":"Order #1042"}'
Node.js (server only)
const res = await fetch("https://api.xxpayus.online/api/v1/payments/create", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "X-API-Key": process.env.XXPAYUS_KEY_ID,
    "X-API-Secret": process.env.XXPAYUS_API_SECRET,
  },
  body: JSON.stringify({ method: "cashapp", amount: 50 }),
});
const payment = await res.json();
// Redirect your customer to payment.payment_url

Response · 201

json
{
  "transaction_id": "GGP_EXAMPLE_ORDER",
  "method": "cashapp",
  "amount": 50,
  "status": "pending",
  "expires_at": "2026-10-06T16:30:00.000Z",
  "payment_url": "https://checkout.example.com/provider-payment"
}

Payment flow

  1. 1Your server creates the payment.
  2. 2Redirect your customer to payment_url, the actual HTTPS checkout URL returned by the payment provider.
  3. 3XXPayUS sends a payment webhook to your endpoint.
  4. 4Confirm the final status with GET /transactions/{id} before fulfilling the order.

Idempotency keys are not supported yet. Avoid retrying a create request automatically; check for the transaction first.