Create offer code with the Gumroad API

Creates a discount code that buyers type at checkout. The discount is in cents of the product currency unless offer_type is percent. The amount and universal cannot be changed later.

Identifier
gumroad_create_offer_code

The request

POST https://connect.reportei.com/api/tools/gumroad_create_offer_code/execute
Authorization: Bearer <merchant token>
x-customer-token: <customer token>
Content-Type: application/json
Accept: application/json

{
  "customer_toolkit": "<connection UUID>",
  "arguments": {
    "product_id": "<product_id>",
    "name": "<name>",
    "amount_off": 1
  }
}

Your system sends your customer's connection id and the tool arguments. The headers are the same as the rest of the Connect API: your product's token and your customer's token.

Parameters

ParameterTypeRequiredDescription
product_idstringYesId of the product, from List products.
namestringYesThe code the buyer types at checkout, such as BLACKFRIDAY30.
amount_offintegerYesDiscount: cents of the product currency, or a percentage when offer_type is percent.
offer_typestringNocents by default.Values: cents, percent
universalbooleanNotrue makes the code valid for every product of the account. false by default.
max_purchase_countintegerNoHow many times the code can be used.
minimum_amount_centsintegerNoMinimum order total, in cents, for the code to apply.
valid_atstringNoStart of validity, RFC 3339 with time zone, such as 2026-11-27T00:00:00-03:00.
expires_atstringNoEnd of validity, in the same format. It needs valid_at and must come after it.
auto_applybooleanNotrue applies the discount by itself on product pages, as a sale. Only for a universal code, and only one per account.
sale_labelstringNoPlain text label of the automatic sale, up to 32 characters. Sale when empty.

Supported connections

Your customer connects their Gumroad account once, with one of the modes below. The same connection serves every tool of the toolkit.

API key

Your customer pastes the app's key on a Connect screen, or your system sends the key with POST /api/customer-toolkits, with no screen.

OAuth with your product's app

You register your product's OAuth app once, with POST /api/merchants/credentials/gumroad, and your customer authorizes the account on a consent screen. Connect renews the token when it is about to expire.

The response

On success, Connect preserves the app's response status and body. HTTP errors returned by the app use the {error, api_error} envelope; authentication or validation can fail before execution. The X-Toolkit-Execution-Id header identifies the recorded execution, available at GET /api/tools/executions/{uuid}.

Ready for AI agents

This tool's input is a JSON Schema, available at GET /api/tools/gumroad_create_offer_code. It becomes your agent's tool definition with no conversion.

Other Gumroad tools

See all 12 tools

Toolkits in the same category

See all 100 toolkits

See Connect applied to your product.

Try it for 15 days with no card, or walk our team through your use case.