Developers
REST API
GuidesErrorsLogin
Get API Keys
API Navigation
  • Overview
  • Quick start
  • Authentication
  • Collect a payment
  • Payment status
  • Refunds
  • Testing
  • Production
  • Security
API reference
  • Create API keys POST
  • List API keys GET
  • Get API key GET
  • Delete API key DEL
  • Collect with MTN POST
  • MTN payment status GET
  • Collect with Airtel POST
    Create and pay
  • Create order POST
  • Order fee POST
  • Pay order with card POST
  • Pay order with bank POST
  • Status and verify
  • Order status POST
  • Verify order POST
  • Cards and tokens
  • Save card POST
  • Tokenize charge GET
  • Refunds
  • Refund order POST
  • Lists and stats
  • List orders GET
  • Get order GET
  • List banks GET
  • Order stats GET
  • List transactions GET
  • Get transaction GET
  • Transaction statuses GET
Errors and limits
  1. Docs
  2. API reference
  3. Pay order with card

Pay order with card

Pay an existing order reference with card details.

OpenAPI SpecRun in Postman
POST/payment/zibapay/card/:referenceAPI
Authentication:Bearer token•Authorization: Bearer <token>(Bearer token for server-to-server API calls)
Security requirement: 403 CSRF Protection
Auth guide →

Direct server-to-server calls authenticated via Bearer tokens do not require CSRF headers. If you instead invoke mutation endpoints from a web browser using cookie-based sessions, you must include the following header:

X-Requested-With: XMLHttpRequest

Request Parameters

FieldTypeRequiredDescription
referencestringRequiredtransactionReferenceId from the collect response, or the order reference.
import axios from "axios";

const url = "https://payment-service-mh2d.onrender.com/api/payment/zibapay/card/:reference";

const headers = {
    Authorization: `Bearer ${process.env.ZIBA_TOKEN}`,
    "Content-Type": "application/json",
};

const payload = {
  "card": {
    "cardnumber": "4111111111111111",
    "expirymonth": "12",
    "expiryyear": "2028",
    "cvv": "123"
  },
  "country": "NG",
  "paymentoption": "card"
};

try {
  const response = await axios.post(url, payload, {
    headers,
    timeout: 15000,
  });
  console.log("Success:", response.status, response.data);
} catch (error) {
  console.error("Request failed:", error.response?.data || error.message);
}
Auth guide

Response fields

FieldTypePresenceDescription
statusstringAlways returnedPayment status: COMPLETED, PENDING, or FAILED.
referencestringAlways returnedOrder reference identifier.
transactionIdstringAlways returnedTransactPay transaction identifier.
amountnumberAlways returnedAmount charged.
currencystringAlways returnedCurrency charged.
redirectUrlstringOptionalProvider return URL when the checkout flow supplies one. 3-D Secure is not confirmed.
messagestringOptionalGateway status or confirmation message.

Status codes

HTTP StatusMeaning
200Card payment processed.
401No merchant session.

Notes

  • HTTP 200 returns the provider payment confirmation payload. Illustrative example.

Related

Create orderVerify order
Was this page helpful?

Let us know how we can make our API documentation better.

PreviousOrder fee
NextPay order with bank