GiftRocket gift card API for python
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


A python client library for the GiftRocket API.


$ pip install giftrocket-python

Getting started

All API requests require an access token. A sandbox access token is assigned upon signup through the GiftRocket Dashboard. Once you are ready to move to production, you will be assigned a production access token.


from giftrocket import GiftRocket

# Sandbox environment
client = GiftRocket("[SANDBOX_ACCESS_TOKEN]", "")

# Production environment
client = GiftRocket("[PRODUCTION_ACCESS_TOKEN]", "")


See API documentation for all Order options. Use the FoundingSources resource to look up a valid method for your payment (i.e. credit card, ACH, etc).

# Create a new order, specifying your gift options
# as an array of objects.
response = client.create_order({
  "funding_source_id": "[FUNDING_SOURCE_ID]",
  "gifts": [
      "amount": 40,
      "message": "Such a great way to show appreciation to others!",
      "recipient": {
        "email": "",
        "name": "Person Example"
      "style_id": "[STYLE_ID]"

if response.ok:
    order = response.to_json()["order"]

# Return historical orders, optionally passing a starting offset for results.
response = client.get_orders({offset: 10})

# Return a order by order_id
response = client.get_order("[ORDER_ID]")

Funding Sources

Production funding sources must be added through the web dashboard. A sandbox funding source is provided during development.

# Retrieve a list of your funding sources (credit card, ach, etc).
response = client.get_funding_sources()


A style defines the presentation of your gift. The styles endpoint returns an array of card designs.

response = client.get_styles()


Retrieve a single or many historical gifts sent by your account.

response = client.get_gifts({offset: 10})

response = client.get_gift("[GIFT_ID]")