Creating a Sell Transaction

This page explains how to create a new gift card sell transaction using the Prestmit API.

Creating a Sell Transaction

Ready to help your users sell their gift cards? This guide walks you through creating sell gift card transactions using the Prestmit API.


Quick Overview

Creating a sell transaction involves:

  1. Getting the right gift card details (using our lookup endpoints)
  2. Collecting the card information from your user
  3. Sending the transaction request
  4. Handling the response

Let's dive in!


The Request Format

Endpoint: POST /giftcard-trade/sell/create

Content Type: multipart/form-data


Required Fields

FieldTypeDescription
giftcard_idNumberThe specific gift card type ID
amountNumberTotal value of the gift card
payoutMethodStringHow you want to get paid (see available options)
attachments[]File(s)Photos of the gift card

Optional Fields

FieldTypeDescription
commentsStringExtra details or the gift card code
uniqueIdentifierStringYour internal tracking reference

File Upload Guidelines

Keep these limits in mind when uploading gift card images:

  • Formats: JPG, PNG only
  • File size: Maximum 5MB per image
  • Quantity: Up to 20 images per transaction

For eCodes: Skip the attachments and put the code in the comments field instead.


Finding the Right Gift Card

Before creating a transaction, you'll need the correct giftcard_id. Here's how to find it:


Step 1: Get Categories

Start with the main brands using:

GET /lookup/sell-giftcard-categories

This shows options like Apple, Amazon, Steam, etc.


Step 2: Get Subcategories

Once users pick a brand, get specific variants:

GET /lookup/sell-giftcard-subcategories

This reveals details like "USA Apple Physical ($50-$100)" with exact rates and requirements.


Step 3: Apply Filters (Optional)

Narrow down options by region or card type:

GET /lookup/sell-giftcard-filters

Example : Physical Apple Card

Your user (john_doe_001) wants to sell a $100 Apple physical card from the US:

POST /giftcard-trade/sell/create
Content-Type: multipart/form-data

giftcard_id: 123
amount: 100
payoutMethod: NAIRA
comments: Purchased from Best Buy yesterday, receipt included
attachments: [front_card.jpg, back_card.jpg, receipt.jpg]
uniqueIdentifier: john_doe_001

Sample Response

When everything goes right, you'll get a response like this:

{
    "success": true,
    "details": "Gift card sell trade successfully started.",
    "trade": {
        "reference": "SGC586326085289",
        "rate": 70,
        "units": "798",
        "totalAmount": 55860,
        "status": "PENDING",
        "comments": "Amazon gift card purchased on August 30",
        "rejectionReason": null,
        "createdAt": "2021-02-13T01:41:08+01:00",
        "category": {
            "id": 1,
            "name": "Apple Gift Card",
            "image": "https://example.com/itunes-card.png"
        },
        "giftcard": {
            "id": 1,
            "name": "Apple eCodes",
            "rate": 70,
            "minimum": 100,
            "terms": "Standard terms and conditions apply"
        }
    }
}

What Happens Next?

After creating the transaction:

  1. Status starts as "PENDING" - We're reviewing the submission
  2. Reference number generated - Use this to track the transaction
  3. Wait for webhooks - We'll notify you when the status changes

What’s Next

Next... let's go through the process of tracking a sell gift card transaction status over the API.