Getting paid

Shopify offers billing APIs that let you charge the merchants who are using your sales channel. There are two different ways that you can generate revenue through a sales channel app:

Using the Recurring Application Charge API

When the merchant installs your sales channel, use this API to set up their monthly billing. Store the ID for the merchant's recurring application charge for use with the Usage Charge API.

If you don't want to charge a base rate every month, then you can charge $0 per month and use the Usage Charge API to charge commission on every sale.

Learn more about the Recurring Application Charge API.

Sample request

POST /admin/recurring_application_charges.json HTTP/1.1
Host: merchantstore.myshopify.com
X-Shopify-Access-Token: d28d969fdd25cc30d63d7ae242187310
Content-Type: application/json

{
  "recurring_application_charge": {
    "name": "Marketplaceify",
    "return_url": "https://marketplaceify.shopifyapps.com/",
    "test": true,
    "capped_amount": 5000,
    "terms": "10% of your gross sales through our marketplace"
  }
}

View Response

HTTP/1.1 201 Created
Content-Type: application/json; charset=utf-8
X-Shopify-Shop-Api-Call-Limit: 1/40

{
    "recurring_application_charge": {
        "id": 1890230,
        "name": "Marketplaceify",
        "api_client_id": 1213286,
        "price": "0.00",
        "status": "pending",
        "return_url": "https://marketplaceify.shopifyapps.com/",
        "billing_on": null,
        "created_at": "2016-02-08T00:08:26-05:00",
        "updated_at": "2016-02-08T00:08:26-05:00",
        "test": true,
        "activated_on": null,
        "trial_ends_on": null,
        "cancelled_on": null,
        "trial_days": 0,
        "capped_amount": "5000.00",
        "balance_used": "0.00",
        "balance_remaining": "5000.00",
        "decorated_return_url": "https://marketplaceify.shopifyapps.com/?charge_id=1890230",
        "confirmation_url": "https://merchantstore.myshopify.com/admin/charges/1890230/confirm_recurring_application_charge?signature=BAhpA7bXHA%3D%3D--49fac4774fd2b1a90e831239cab3a4073c30a046"
    }
}

Using the Usage Charge API

After the recurring application charge has been activated, your sales channel can begin creating usage charges.

Learn more about the Usage Charge API.

Sample request

POST /admin/recurring_application_charges/1890230/usage_charges.json HTTP/1.1
Host: merchantstore.myshopify.com
X-Shopify-Access-Token: d28d969fdd25cc30d63d7ae242187310
Content-Type: application/json

{
  "usage_charge": {
    "price": "10.00",
    "description": "Today you sold 4 items for $25 each on Marketplaceify and this is our cut"
  }
}

View Response

HTTP/1.1 201 Created
Content-Type: application/json; charset=utf-8
X-Shopify-Shop-Api-Call-Limit: 1/40

{
    "usage_charge": {
        "id": 42,
        "description": "Today you sold 4 items for $25 each on Marketplaceify and this is our cut",
        "price": "10.00",
        "platform_id": null,
        "billing_on": "2016-02-08",
        "balance_used": "10.00",
        "balance_remaining": "4990.00"
    }
}