Create offer
Create a canonical offer scoped to one or more plan prices. Currency-specific phases require an explicit USD value and never fall back across currencies.
Create a canonical offer scoped to one or more plan prices. Currency-specific phases require an explicit USD value and never fall back across currencies.
Authorization
ApiKeyAuth In: header
Header Parameters
Unique key used to safely retry this write for 24 hours without applying it twice.
1 <= length <= 200Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
1 <= length <= 200Value in
- "introductory"
- "promotional"
1 <= items1 <= items <= 10{}nullnulltrueResponse Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/offers" \ -H "Content-Type: application/json" \ -d '{ "name": "string", "purpose": "introductory", "planPriceIds": [ "string" ], "phases": [ { "type": "free_trial", "durationDays": 1 } ] }'{ "id": "string", "name": "string", "purpose": "introductory", "planPriceIds": [ "string" ], "phases": [ { "type": "free_trial", "durationDays": 1 } ], "metadata": { "property1": null, "property2": null }, "startsAt": "2019-08-24T14:15:22Z", "endsAt": "2019-08-24T14:15:22Z", "active": true, "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z", "object": "offer", "livemode": true}{ "error": { "type": "string", "code": "string", "message": "string", "param": "string", "details": null, "doc_url": "string" }}{ "error": { "type": "string", "code": "string", "message": "string", "param": "string", "details": null, "doc_url": "string" }}{ "error": { "type": "string", "code": "string", "message": "string", "param": "string", "details": null, "doc_url": "string" }}{ "error": { "type": "string", "code": "string", "message": "string", "param": "string", "details": null, "doc_url": "string" }}{ "error": { "type": "string", "code": "string", "message": "string", "param": "string", "details": null, "doc_url": "string" }}{ "error": { "type": "string", "code": "string", "message": "string", "param": "string", "details": null, "doc_url": "string" }}{ "error": { "type": "string", "code": "string", "message": "string", "param": "string", "details": null, "doc_url": "string" }}{ "error": { "type": "string", "code": "string", "message": "string", "param": "string", "details": null, "doc_url": "string" }}