Payments

Create and manage payments with the Shika Creators API.

Payments API

The Payments API allows you to create, retrieve, and manage payments.

The Payment Object

Payment Object
{
  "id": "pay_abc123def456",
  "object": "payment",
  "status": "succeeded",
  "amount": 50,
  "currency": "GHS",
  "fee": 1.50,
  "net_amount": 48.50,
  "payment_method": {
    "type": "mobile_money",
    "provider": "mtn",
    "number": "024****567",
    "name": "John Doe"
  },
  "description": "Order #1234",
  "metadata": {
    "order_id": "1234"
  },
  "provider_reference": "OP123456789",
  "failure_reason": null,
  "created_at": "2024-01-15T10:30:00Z",
  "completed_at": "2024-01-15T10:30:45Z"
}

Attributes

AttributeTypeDescription
idstringUnique identifier for the payment
objectstringAlways "payment"
statusstringcreated, pending, processing, succeeded, failed, cancelled
amountnumberAmount in GHS
currencystringThree-letter ISO currency code (GHS)
feenumberTransaction fee in GHS
net_amountnumberNet amount after fees in GHS
payment_methodobjectPayment method details
payment_method.typestringmobile_money, bank_transfer, or shika_wallet
payment_method.providerstringProvider: mtn, telecel, airteltigo
payment_method.numberstringMasked phone/account number
payment_method.namestringAccount holder name
descriptionstringDescription of the payment
metadataobjectCustom key-value pairs
provider_referencestringProvider transaction reference
failure_reasonstringError message if failed
created_atstringISO 8601 timestamp
completed_atstringCompletion timestamp

Create a Payment

Creates a new payment request.

POST /v1/payments

Request Body

ParameterTypeRequiredDescription
amountnumberYesAmount in GHS (e.g., 50 for GHS 50.00)
currencystringNoCurrency code (default: GHS)
payment_methodobjectYesPayment method details
payment_method.typestringYesmobile_money or bank_transfer
payment_method.phone_numberstringYes*Phone number (for mobile money)
payment_method.providerstringNoProvider code (auto-detected from phone)
payment_method.account_numberstringYes*Account number (for bank transfer)
payment_method.bank_codestringYes*Bank code (for bank transfer)
descriptionstringNoPayment description
metadataobjectNoCustom metadata

Use the X-Idempotency-Key header to prevent duplicate payments.

curl -X POST https://api.shikacreators.com/v1/payments \
  -H "Authorization: Bearer sk_test_..." \
  -H "Content-Type: application/json" \
  -d '{
    "amount": 50,
    "currency": "GHS",
    "payment_method": {
      "type": "mobile_money",
      "phone_number": "0241234567"
    },
    "description": "Order #1234",
    "metadata": {
      "order_id": "1234"
    }
  }'
const payment = await shikacreators.payments.create({
  amount: 50,
  currency: 'GHS',
  payment_method: {
    type: 'mobile_money',
    phone_number: '0241234567'
  },
  description: 'Order #1234',
  metadata: {
    order_id: '1234'
  }
})
payment = client.payments.create(
    amount=50,
    currency='GHS',
    payment_method={
        'type': 'mobile_money',
        'phone_number': '0241234567'
    },
    description='Order #1234',
    metadata={'order_id': '1234'}
)
$payment = $shikacreators->payments->create([
    'amount' => 50,
    'currency' => 'GHS',
    'payment_method' => [
        'type' => 'mobile_money',
        'phone_number' => '0241234567'
    ],
    'description' => 'Order #1234',
    'metadata' => ['order_id' => '1234']
]);

Response

{
  "id": "pay_abc123def456",
  "object": "payment",
  "status": "created",
  "amount": 50,
  "currency": "GHS",
  "fee": 1.50,
  "net_amount": 48.50,
  "payment_method": {
    "type": "mobile_money",
    "provider": "mtn",
    "number": "024****567",
    "name": null
  },
  "description": "Order #1234",
  "metadata": {
    "order_id": "1234"
  },
  "provider_reference": null,
  "failure_reason": null,
  "created_at": "2024-01-15T10:30:00Z",
  "completed_at": null
}

Retrieve a Payment

Retrieves a payment by ID.

GET /v1/payments/:id
curl https://api.shikacreators.com/v1/payments/pay_abc123def456 \
  -H "Authorization: Bearer sk_test_..."
const payment = await shikacreators.payments.retrieve('pay_abc123def456')
payment = client.payments.retrieve('pay_abc123def456')

List Payments

Returns a list of payments.

GET /v1/payments

Query Parameters

ParameterTypeDescription
limitintegerNumber of results (1-100, default 10)
starting_afterstringCursor for pagination
ending_beforestringCursor for pagination
statusstringFilter by status
customerstringFilter by customer ID
created[gte]stringFilter by creation date
created[lte]stringFilter by creation date
curl "https://api.shikacreators.com/v1/payments?limit=10&status=succeeded" \
  -H "Authorization: Bearer sk_test_..."
const payments = await shikacreators.payments.list({
  limit: 10,
  status: 'succeeded'
})
payments = client.payments.list(limit=10, status='succeeded')

Response

{
  "object": "list",
  "data": [
    {
      "id": "pay_abc123def456",
      "object": "payment",
      "status": "succeeded",
      "amount": 50,
      "currency": "GHS",
      "fee": 1.50,
      "net_amount": 48.50,
      "payment_method": {
        "type": "mobile_money",
        "provider": "mtn",
        "number": "024****567"
      },
      ...
    }
  ],
  "has_more": true,
  "url": "/v1/payments"
}

Shika Wallet Payments

Payments with payment_method.type: "shika_wallet" are initiated by Shika Creators consumer app users scanning your merchant QR code. These payments are settled instantly from the consumer's Shika wallet to your merchant balance.

Shika Wallet payments are created through the consumer app, not through the API directly. They appear in your payment list with payment_method.type: "shika_wallet". No external provider is involved — settlement is instant.

How it works

  1. Generate a QR code using the QR Codes API
  2. Display the QR code at your point of sale or in your application
  3. The consumer scans it with the Shika Creators app and confirms payment
  4. Funds are instantly credited to your merchant balance
  5. You receive a payment.completed webhook event

Shika Wallet Payment Object

{
  "id": "pay_abc123def456",
  "object": "payment",
  "status": "completed",
  "amount": 50,
  "currency": "GHS",
  "fee": 0.60,
  "net_amount": 49.40,
  "payment_method": {
    "type": "shika_wallet",
    "provider": null,
    "number": "acc_xxx",
    "name": "John Doe"
  },
  "description": "Shika Wallet payment via QR",
  "metadata": {
    "qr_code_id": "qr_abc123",
    "consumer_account_id": "acc_xxx",
    "payment_type": "shika_wallet_qr"
  },
  "created_at": "2024-01-15T10:30:00Z",
  "completed_at": "2024-01-15T10:30:00Z"
}

Payment Statuses

StatusDescription
createdPayment has been created
pendingPayment is pending customer authorization
processingPayment is being processed
succeededPayment was successful
failedPayment failed
cancelledPayment was cancelled
refundedPayment was fully refunded
partially_refundedPayment was partially refunded

Webhook Events

EventDescription
payment.createdPayment was created
payment.pendingPayment is pending authorization
payment.completedPayment was successful
payment.failedPayment failed
app.post('/webhooks', (req, res) => {
  const event = Webhook.constructEvent(req.body, signature, secret)

  switch (event.type) {
    case 'payment.completed':
      const payment = event.data.object
      console.log(`Payment ${payment.id} completed!`)
      break
    case 'payment.failed':
      const failedPayment = event.data.object
      console.log(`Payment failed: ${failedPayment.failure_reason}`)
      break
  }

  res.json({ received: true })
})