Giftship Checkout API

You can use Giftship to create a multiple shipping address checkout from any platform by using this guide.

View API Documentation:

https://documenter.getpostman.com/view/3477289/RztoNUhL

Checkout API Endpoint:

https://gs.appsbypix.com/api/checkout/

Step 1:

Generate an API key in Gifship’s settings page within Shopify Admin. Record your access token in a safe place, and ensure that you keep it a secret. Before making API calls, please ensure to enable API access on the same page you generate the token.

Step 2: Making Requests

Set a X-Giftship-Access-Token header using the access token you generated in Giftship’s dashboard with your request.

curl -X POST \
https://gs.appsbypix.com/api/checkout/ \
-H 'Content-Type: application/json' \
-H 'X-Giftship-Access-Token: YOUR_ACCESS_TOKEN_HERE' \
-H 'cache-control: no-cache' \
-d 'YOUR_POST_DATA_HERE'

Make a POST request to the API endpoint at the top of this page, using the following format:

{
"myshopify_url": "giftship4.myshopify.com",
"line_items": [
{
"variant_id": 15377376673856,
"product_id": 1559202398272,
"quantity": 1,
"address": {
"name": "John Smith",
"address1": "111 Fake Avenue",
"address2": "#100",
"city": "Hollywood",
"state": "California",
"country": "United States",
"zip": "90210",
"phone": "123-456-7891",
"company": "Fake Company"
},
"properties": {
"Message": "Put your custom gift message here!",
"Delivery Date": "02-31-2019"
}
},
{
"variant_id": 15377370316864,
"product_id": 1559201742912,
"quantity": 1,
"address": {
"name": "Jane Doe",
"address1": "123 Test Street",
"city": "Calgary",
"state": "Alberta",
"country": "Canada",
"zip": "T2X1T9"
},
"properties": {
"Message": "Happy birthday Jane Doe!",
"Delivery Date": "03-21-2019"
}
}
],
"shipping_lines": [
{
"name": "UPS 3 Day Ground",
"price": 3000,
"address": {
"name": "Jane Doe",
"address1": "123 Test Street",
"city": "Calgary",
"state": "Alberta",
"country": "Canada",
"zip": "T2X1T9"
}
}
],
"note_attributes": [
{
"name": "Delivery Instructions",
"value": "Please include the thank you note, and drop on their doorstep",
"address": {
"name": "John Smith",
"address1": "111 Fake Avenue",
"address2": "#100",
"city": "Hollywood",
"state": "California",
"country": "United States",
"zip": "90210",
"phone": "123-456-7891",
"company": "Fake Company"
}
},
{
"name": "Delivery Instructions",
"value": "Please include a happy birthday card",
"address": {
"name": "Jane Doe",
"address1": "123 Test Street",
"city": "Calgary",
"state": "Alberta",
"country": "Canada",
"zip": "T2X1T9"
}
},
{
"name": "note",
"value": "Enter a note here to display on the recreated order",
"address": {
"name": "Jane Doe",
"address1": "123 Test Street",
"city": "Calgary",
"state": "Alberta",
"country": "Canada",
"zip": "T2X1T9"
}
},
{
"name": "note",
"value": "Enter a note here to display on the recreated order",
"address": {
"name": "Jane Doe",
"address1": "123 Test Street",
"city": "Calgary",
"state": "Alberta",
"country": "Canada",
"zip": "T2X1T9"
}
}
],
"note": "ENTER A NOTE FOR THE INITIAL ORDER HERE.",
"discount": {
"title": "$10_OFF_CODE",
"amount": 1000
},
"customer_id": 899845193792
}

Step 3: Redirecting to checkout

If all is good, you will receive a response in the following format, which you can then redirect the customer to the checkout_url in order to complete the checkout:

{
"status": "success",
"id": 142740652096,
"checkout_url": "https://giftship4.myshopify.com/6542327872/invoices/ef722fdde0d591a493bdb0645268fca0",
"total_price": "158.58"
}

Examples

Example in cURL/PHP:

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
CURLOPT_URL => "https://gs.appsbypix.com/api/checkout/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "YOUR_POST_DATA_HERE",
CURLOPT_HTTPHEADER => array(
"Content-Type: application/json",
"X-Giftship-Access-Token: YOUR_ACCESS_TOKEN_HERE",
"cache-control: no-cache"
),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}

Example in Node:

var http = require("https");

var options = {
"method": "POST",
"hostname": [
"gs",
"appsbypix",
"com"
],
"path": [
"api",
"checkout",
""
],
"headers": {
"Content-Type": "application/json",
"X-Giftship-Access-Token": "YOUR_ACCESS_TOKEN_HERE",
"cache-control": "no-cache",
}
};

var req = http.request(options, function (res) {
var chunks = [];

res.on("data", function (chunk) {
chunks.push(chunk);
});

res.on("end", function () {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
});

req.write(JSON.stringify(YOUR_POST_DATA_HERE));
req.end();

Can't find the answer in our documentation?
Contact Support
Using a Drawer or Popup Cart with Giftship’s Features
Sending non-physical products to multiple recipients
How to Disable Giftship on Your Live Theme
Installing Giftship
Find the Right Billing Plan
Configuring One-Click Upsells
How to Charge for a Gift Message
Configuring Multi-Product Upsells
Configuring Email Templates
Change the location of Giftship’s features
Configuring Gift Messages
Orders are not splitting for multiple shipping address orders
Giftship Not Working with Drawer/ Slide-Out Cart
Using “Buy Now” Button is Skipping Giftship’s Features
Using the product options feature
Change the datepickers settings based on products in the cart
Hide prices on your order printer packing slip if the “Is this a gift?” checkbox is checked
Using Giftship in Multiple Languages
Order Printer Packing Slip Template With Gift Messages
Editing Shipstation Packing Slips
Only Show ‘Ship to Multiple Address’ Toggle if More Than 1 Item in Cart
Change the Location of the “Ship to multiple addresses” Checkbox
Using Tax Overrides for Multiple Address Checkouts
Previewing Giftship on Your Website Before Publishing Live
Stock Email Template for Multiple Shipping Address Orders
Prevent Multiple Emails from Being Sent when Shipping to Multiple Addresses
Integration with Wholesale & Volume Discount Applications
Giftship Checkout API
Enable Order Notes for Shipping to Multiple Addresses
Preventing “Hidden” Line Item Properties from Displaying on Your Store
Fulfilling Multiple Shipping Address Orders
Configuring the Delivery Date Picker
Collecting the Email Address of a Gift Recipient
Hiding Upsell Products on Your Online Store
Issuing Refunds for Multiple Shipping Address Orders
Discount Codes for Multi-address orders.
Showing Giftship’s Options Only on Certain Products
Upcoming Orders – How It Works
Making Ship to Multiple Address Cart the Default Cart
Ensuring the Logo Link is Active and ‘Back to Cart’ Breadcrumb is Always Present During Checkout
Displaying Gift Message and Date Details in Email Templates
Viewing Reports with Multiple Shipping Address Orders
Printing Gift Messages
Installing Product Bundle Snippets
Giftship Information & Pricing
Giftship Feature Overview