AfroPin
For developers

An API your team can ship in days

Everything the till does is open to your platform: sell and top up gift cards, check and redeem them, quote businesses in bulk, and hear about every change by webhook. Official SDKs in four languages.

The docs are open to read. Test keys are free: sign up and start building straight away.

Official SDKs for your stack

PHP, Node.js, Python and Java, with the same calls in each. They sign every request, add idempotency keys, check webhook signatures and give you one error type to branch on.

  • No dependencies beyond the language itself
  • Every endpoint, for brands and resellers
  • Lists as pages, errors with stable codes
  • Or call the API directly: HMAC-signed JSON over HTTPS
$ composer require afropin/afropin-php
$afropin = new AfroPin\Client($keyId, $secret);

$pin = $afropin->reseller->pins->sell([
    'catalog_id' => $catalogId,
    'amount' => 5000,
    'external_reference' => $orderId,
    'first_name' => 'Ada', 'last_name' => 'Obi',
    'email' => '[email protected]',
]);

$pin['pin_code'];  // deliver it to your customer

Two APIs, one for each side of the network

Brand API

Accept and sell your gift cards

  • Check a gift card, then redeem it in full or in part
  • Sell and top up your own gift cards from your app
  • Quote businesses for cards in bulk, paid on a hosted page
  • Payments, stores, wallets and printed cards
  • Google Wallet and Apple Wallet links for every card
Read the brand docs
Reseller API

Sell gift cards from your app

  • List the catalog of brands you can sell, with your commission
  • Sell and top up cards, with a kept code or a daily limit
  • Give a card a new code, block or unblock it
  • Activate printed cards and add cards to phone wallets
  • Stores and brand stores, for where cards are sold and spent
Read the reseller docs

Told about every change, as it happens

Signed webhooks to your server for each card you sell or accept, whoever acted: your till, our API, or the cardholder in their own account. Retried if your server is down, and resent from your dashboard.

  • pin.soldA card was sold, with its code to deliver
  • pin.topped_upValue was added
  • pin.spentA card was redeemed, in full or in part
  • pin.code_changedA card got a new code
  • pin.expiredA card passed its expiry
  • pin.frozenA card was frozen, by you or its holder
  • pin.unfrozenA frozen card can be spent again
  • pin.movedMoney moved to or from a family card
  • quote.paidA business paid a brand's quote
  • quote.sentA paid quote's cards went out

Every event and its payload

Your customers manage their own cards

Every card you sell comes with a card account, linked from its emails and wallet pass. Your integration doesn't have to build any of it, and your webhook hears each change.

Balance and history

Every card under the customer's email, whoever sold it, signed in with a code by email.

Freeze and new codes

Freeze a lost card, get a new code once a day, keep one code or set a daily limit.

Top up by card

The payment goes to the seller's wallet as a normal top-up, with the reseller's commission.

Family cards

Cards for their family, funded from theirs, each with its own code and limit.

Transfer ownership

Hand a card to someone else, who gets a new code only they receive.

Phone wallets

Cards in Google Wallet, with the code and QR ready at the till and the balance kept up to date.

From test keys to live in four steps

  1. 01

    Sign up

    Open a brand or reseller account online and create your test keys.

  2. 02

    Build in test mode

    Use an SDK or the Postman collection, with test gift cards. No real money moves.

  3. 03

    Run the test cases

    Work through the UAT cases in the docs to check every path, including errors.

  4. 04

    Go live

    Once your business is verified, switch to live keys and start trading.

Start building today

Sign up online and create test keys straight away. Our integration team is on hand if you get stuck.