Startbutton Product API
  • Startbutton API doc
    • Get Started
    • Accept Payments
    • Server-to-Server Integration
      • S2S Integration for Virtual Accounts
        • S2S Virtual account (NGN)
        • S2S Virtual account (GHS)
        • S2S EFT (ZAR)
      • S2S Integration for Mobile Money
        • S2S MoMo (KES and GHS)
        • S2S MoMo (TZS and UGX)
        • S2S MoMo (RWF)
        • S2S MoMo XOF and XAF
    • Re-charge Card
    • Subscriptions
    • Payment Links
    • Currency Conversion
    • Get Wallet Balance
    • Transfer
      • Bank List
    • Security Measures.
      • IP Whitelisting
    • Webhook
    • Transaction Status
    • Get FX Rate
    • Under and Overpayments
    • Refunds
      • Refund Transaction Status (TSQ)
    • Available Currencies
    • FAQs
  • Advanced Security
    • Signed Payload for Transfer Requests.
Powered by GitBook
On this page
  • Enable Card Re-Charge
  • Complete First Charge
  • Store Card Authorization Code
  • Post Re-Charge Request
  • Webhooks
  1. Startbutton API doc

Re-charge Card

Startbutton's 'Re-charge' feature allows you to charge your customer's card for subsequent transactions after the first charge has been successfully authenticated and completed.

Enable Card Re-Charge

Hey there! Please contact the Startbutton team if you would like to access this feature. With a single API, you can initiate a card re-charge on domestic and international cards.

Complete First Charge

In order for us to ensure that the card is valid and can be charged for subsequent transactions, initializing a first charge is required. You could do this as described here for your customer's first transaction with the card.

The minimum amount we recommend for the first charge is NGN 50.00, GHS 0.10. Lower amounts are not guaranteed to work on all card brands or banks.

Store Card Authorization Code

Once the first transaction is successful (via the initialize transaction endpoint), you should have the webhook payload by listening for webhook notifications or getting the transaction status.

Store the authorizationCode returned to you via the webhook payload or the 'get transaction status' endpoint. This can be used to charge the card subsequently. Avoid saving an authorizationCode multiple times.

{
  event: "collection.completed",
  data: {
    merchantId: "64459778bf350cc65485986c",
    paymentPartner: {
      id: "644a50bb188729db2115443b"
      name: "Paystack",
      currency: "NGN",
    },
    transaction: {
      _id: "648ca8aba0fa641316284dc3",
      transType: "collection",
      status: "processing",
      toAmount: 200000,
      toCurrency: "NGN",
      merchantId: "64459778bf350cc65485986c",
      transactionReference: "69f146f0487b",
      customerEmail: "test@customer.com",
      paymentCode:
        "d316a59258c21bd06d23288ce8cedc679686bef8a9907e89bc6e630fb2a1e32f639d4bee4deeb8aaf3e8dada44867a0650e32d60feae47f2a99099f96d176d1b00434876b29e8a03a728312bec3cfc429b7ac26fc73021ab13551e104e2f2680",
      isRecurrent: "false"
      createdAt: "2023-06-16T18:23:39.716Z",
      updatedAt: "2023-06-16T18:23:41.837Z",
      __v: 0
      },
      authorizationCode: "f2e4a43dc7bxxx"
    },
  },
{
  event: "collection.completed",
  data: {
    merchantId: "64459778bf350cc65485986c",
    paymentPartner: {
      name: "Paystack",
      currency: "NGN",
    },
    transaction: {
      _id: "648ca8aba0fa641316284dc3",
      transType: "collection",
      status: "processing",
      toAmount: 2000,
      toCurrency: "NGN",
      merchantId: "64459778bf350cc65485986c",
      transactionReference: "69f146f0487b",
      customerEmail: "test@customer.com",
      paymentPartnerId: {
        name: "Paystack",
        currency: "NGN",
      },
      paymentCode:
        "d316a59258c21bd06d23288ce8cedc679686bef8a9907e89bc6e630fb2a1e32f639d4bee4deeb8aaf3e8dada44867a0650e32d60feae47f2a99099f96d176d1b00434876b29e8a03a728312bec3cfc429b7ac26fc73021ab13551e104e2f2680",
      createdAt: "2023-06-16T18:23:39.716Z",
      updatedAt: "2023-06-16T18:23:41.837Z",
    },
  },
};

Post Re-Charge Request

For subsequent card charges, send the authorizationCode and amount in the param.

Authorization
Set value to SECRET_KEY

Content-type

Set value to application/json

The secret key can be gotten from the 'Settings' page on your Startbutton dashboard.

Post a request to the URL below, where the base URL is determined by the environment you are on.

BaseUrls

PROD : https://api.startbutton.tech

DEV/ Staging: https://api-dev.startbutton.tech

POST {{baseurl}}/transaction/recurrent

Sample request:

{
    "authorizationCode": "f2e4a43dc7b313",
    "amount": 27000,
    "reference": "43ntjb4tph"
}

Sample response:

{
    "success": true,
    "message": "transaction",
    "data": "processing"
}

Webhooks

Go here to understand webhooks and getting transaction status

isRecurrent is true in the webhook when the card is charged via the Recharge endpoint.

PreviousS2S MoMo XOF and XAFNextSubscriptions

Last updated 2 months ago