APICenter
DocsBuildLearn
APIs & SDKs/APICenter REST API/Create a Checkout

Create a Checkout

POSThttps://api.apicenter.itsandbox.site/api/v1/payments/checkouts

Perform Create a Checkout operation on APICenter platform.

TShttps://api.apicenter.itsandbox.site/api/v1/payments/checkouts
const paymentApiKey = process.env.APICENTER_PAYMENT_API_KEY;
if (!paymentApiKey) throw new Error("APICENTER_PAYMENT_API_KEY is required");
const requestBody = {
  "referenceId": "ACI-20260727-EXAMPLE01",
  "amount": {
    "amountMinor": 39900,
    "currency": "PHP"
  },
  "successUrl": "https://app.example.test/billing/success",
  "cancelUrl": "https://app.example.test/billing/cancel",
  "metadata": {
    "planId": "starter"
  }
};

const response = await fetch("https://api.apicenter.itsandbox.site/api/v1/payments/checkouts", {
  method: "POST",
  headers: {
    Authorization: "Bearer " + paymentApiKey,
    "Idempotency-Key": "unique-key-createCheckout",
    "Content-Type": "application/json"
  },
  body: JSON.stringify(requestBody)
});
if (!response.ok) throw new Error("APICenter request failed: " + response.status);
const data = await response.json();
console.log(data);
Response
{
  "success": true,
  "data": {
    "checkoutId": "chk_example_01",
    "referenceId": "ACI-20260727-EXAMPLE01",
    "status": "pending",
    "amount": {
      "amountMinor": 39900,
      "currency": "PHP"
    },
    "checkoutUrl": "https://checkout.example.test/chk_example_01",
    "aggregateVersion": 1
  }
}

Authentication

AuthorizationAPICenterApiKey

Authorization: Bearer <PAYMENT_API_KEY>. Use the consumer's payment API key. or Registered APICenter service JWT with gateway-enforced scopes.

Headers

Idempotency-KeystringRequired

Unique key for safely retrying this payment mutation. Reuse the same key and request body after uncertain outcomes. A key used with a different request, an in-progress request, or an unresolved provider outcome returns HTTP 409.

Request Body

referenceIdstringRequired
amountobjectRequired
successUrlstringRequired
cancelUrlstringRequired
metadataobjectOptional

Consumer-owned correlation metadata. Do not include secrets.

Response

201Checkout created
successbooleanRequired
dataobjectRequired

Response

202Provider outcome is pending confirmation
successbooleanRequired
dataobjectRequired

Errors

400Invalid request
409The key was used with a different request, is already processing, or the provider outcome remains unresolved. Inspect `error.code`; in particular, `PAYMENT_OUTCOME_UNKNOWN` requires reconciliation before using a new key.
TShttps://api.apicenter.itsandbox.site/api/v1/payments/checkouts
const paymentApiKey = process.env.APICENTER_PAYMENT_API_KEY;
if (!paymentApiKey) throw new Error("APICENTER_PAYMENT_API_KEY is required");
const requestBody = {
  "referenceId": "ACI-20260727-EXAMPLE01",
  "amount": {
    "amountMinor": 39900,
    "currency": "PHP"
  },
  "successUrl": "https://app.example.test/billing/success",
  "cancelUrl": "https://app.example.test/billing/cancel",
  "metadata": {
    "planId": "starter"
  }
};

const response = await fetch("https://api.apicenter.itsandbox.site/api/v1/payments/checkouts", {
  method: "POST",
  headers: {
    Authorization: "Bearer " + paymentApiKey,
    "Idempotency-Key": "unique-key-createCheckout",
    "Content-Type": "application/json"
  },
  body: JSON.stringify(requestBody)
});
if (!response.ok) throw new Error("APICenter request failed: " + response.status);
const data = await response.json();
console.log(data);
Response
{
  "success": true,
  "data": {
    "checkoutId": "chk_example_01",
    "referenceId": "ACI-20260727-EXAMPLE01",
    "status": "pending",
    "amount": {
      "amountMinor": 39900,
      "currency": "PHP"
    },
    "checkoutUrl": "https://checkout.example.test/chk_example_01",
    "aggregateVersion": 1
  }
}