ApplicationCredit

If a merchant requests a refund for an application charge, you can use ApplicationCredit to credit their account for future application purchases. Request to create an application charge credit for a particular amount along with a description explaining why the credit is being issued. A corresponding deduction based on your revenue share will appear in your partner account. For example, if you request to create a credit for $10.00, a deduction of $8.00 will be applied.

The total amount of all ApplicationCredit objects requested by an application must not exceed:

  • Total amount paid to the application by the shop owner in the last 30 days.
  • Total amount of pending receivables in the partner account associated with the application.
Applicationcredit flow

Note

The ApplicationCredit can only be used for applications that use Shopify's Billing API (ApplicationCharge, RecurringApplicationCharge, or UsageCharge).

What you can do with ApplicationCredit

The Shopify API lets you do the following with the ApplicationCredit resource. More detailed versions of these general actions may be available:

ApplicationCredit properties

description
"description": "Super Mega Plan 1000 emails"

The description of the application credit.

id
"id": 675931192

A unique numeric identifier for the application credit.

amount
"amount": 10

The amount refunded by the application credit.

test
"test": null

States whether or not the application credit is a test transaction. Valid values are "true" or "null".

Endpoints

POST /admin/application_credits.json

Applying a credit amount to a shop without previous app purchase will return an error

POST /admin/application_credits.json
{
  "application_credit": {
    "description": "application credit for refund",
    "amount": 5.0
  }
}
View Response
HTTP/1.1 422 Unprocessable Entity
{
  "errors": {
    "base": [
      "Amount exceeded 30 day shop credit issue limit and Amount exceeded pending receivable credit issue limit"
    ]
  }
}

Create a new credit for $5.00 USD

POST /admin/application_credits.json
{
  "application_credit": {
    "description": "application credit for refund",
    "amount": 5.0
  }
}
View Response
HTTP/1.1 201 Created
{
  "application_credit": {
    "id": 1031636131,
    "amount": "5.00",
    "description": "application credit for refund",
    "test": null
  }
}

Creating a credit amount that exceeds total pending receivables for the app will return an error

POST /admin/application_credits.json
{
  "application_credit": {
    "description": "application credit for refund",
    "amount": 5.0
  }
}
View Response
HTTP/1.1 422 Unprocessable Entity
{
  "errors": {
    "base": [
      "Amount exceeded pending receivable credit issue limit"
    ]
  }
}

Creating a credit amount that exceeds shop owner purchases over last 30 days will return an error

POST /admin/application_credits.json
{
  "application_credit": {
    "description": "application credit for refund",
    "amount": 5.0
  }
}
View Response
HTTP/1.1 422 Unprocessable Entity
{
  "errors": {
    "base": [
      "Amount exceeded 30 day shop credit issue limit"
    ]
  }
}

Create a test application credit that will not issue a credit to the merchant

POST /admin/application_credits.json
{
  "application_credit": {
    "description": "application credit for refund",
    "amount": 5.0,
    "test": true
  }
}
View Response
HTTP/1.1 201 Created
{
  "application_credit": {
    "id": 1031636134,
    "amount": "5.00",
    "description": "application credit for refund",
    "test": true
  }
}
GET /admin/application_credits/445365009.json
fields

comma-separated list of fields to include in the response

Retrieve a single application credit

GET /admin/application_credits/#{id}.json
View Response
HTTP/1.1 200 OK
{
  "application_credit": {
    "id": 445365009,
    "amount": "5.00",
    "description": "credit for application refund",
    "test": null
  }
}
GET /admin/application_credits.json
All past and present application credits requests are retrieved by this request.
fields

comma-separated list of fields to include in the response

Retrieving all application credits

GET /admin/application_credits.json
View Response
HTTP/1.1 200 OK
{
  "application_credits": [
    {
      "id": 445365009,
      "amount": "5.00",
      "description": "credit for application refund",
      "test": null
    }
  ]
}