{"openapi":"3.1.0","info":{"title":"Recvd API","version":"1","description":"A business reads its own products, sales and subscriptions with an API key from the Developers page of the Recvd app, and with a key made to write does what it can do in the app: add a product, refund a sale, report usage. Send the key as a bearer token. Amounts are whole numbers in the smallest unit of their currency. Most lists are newest first and page with limit and starting_after; each request says what it takes, and events are listed oldest first after a cursor. Every error is JSON with an error message. The guide is at https://recvd.co/docs.","contact":{"url":"https://recvd.co/docs"}},"servers":[{"url":"https://recvd.co/api/v1"}],"security":[{"apiKey":[]}],"paths":{"/products":{"get":{"operationId":"products.list","summary":"Every product, newest first.","tags":["products"],"parameters":[{"name":"limit","in":"query","description":"How many to return, up to 100; 25 when left out.","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"name":"starting_after","in":"query","description":"The id of the last item of the page before: the answer starts after it.","schema":{"type":"string","description":"The id: 32 lowercase hex characters.","pattern":"^[0-9a-f]{32}$"}}],"responses":{"200":{"description":"The answer.","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Product"}},"has_more":{"type":"boolean","description":"true when there are more to ask for."}},"required":["object","data","has_more"]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/Failed"}}},"post":{"operationId":"products.create","summary":"Add a product. It is not on sale until a person at Recvd has approved it; in a test business it is on sale at once.","tags":["products"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductCreate"}}}},"responses":{"201":{"description":"Made.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Product"}}}},"400":{"description":"A field is missing or not allowed: the message names it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/ReadOnlyKey"},"409":{"description":"The business has a product of that name, or has no merchant of record terms on record yet.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/Failed"}}}},"/products/{id}":{"get":{"operationId":"products.get","summary":"One product.","tags":["products"],"parameters":[{"name":"id","in":"path","required":true,"description":"The id of the object.","schema":{"type":"string","description":"The id: 32 lowercase hex characters.","pattern":"^[0-9a-f]{32}$"}}],"responses":{"200":{"description":"The answer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Product"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"description":"Nothing of yours with that id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/Failed"}}}},"/sales":{"get":{"operationId":"sales.list","summary":"Paid, refunded and disputed sales, newest first.","tags":["sales"],"parameters":[{"name":"limit","in":"query","description":"How many to return, up to 100; 25 when left out.","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"name":"starting_after","in":"query","description":"The id of the last item of the page before: the answer starts after it.","schema":{"type":"string","description":"The id: 32 lowercase hex characters.","pattern":"^[0-9a-f]{32}$"}},{"name":"reference","in":"query","description":"Your own reference, as carried on the checkout link.","schema":{"type":"string"}},{"name":"buyer_email","in":"query","description":"The buyer's email address.","schema":{"type":"string"}}],"responses":{"200":{"description":"The answer.","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Sale"}},"has_more":{"type":"boolean","description":"true when there are more to ask for."}},"required":["object","data","has_more"]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/Failed"}}}},"/sales/{id}":{"get":{"operationId":"sales.get","summary":"One sale.","tags":["sales"],"parameters":[{"name":"id","in":"path","required":true,"description":"The id of the object.","schema":{"type":"string","description":"The id: 32 lowercase hex characters.","pattern":"^[0-9a-f]{32}$"}}],"responses":{"200":{"description":"The answer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Sale"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"description":"Nothing of yours with that id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/Failed"}}}},"/sales/{id}/refund":{"post":{"operationId":"sales.refund","summary":"Refund a paid sale: all of it, or a part. What you were paid for it is taken back first. It cannot be undone.","tags":["sales"],"parameters":[{"name":"id","in":"path","required":true,"description":"The id of the object.","schema":{"type":"string","description":"The id: 32 lowercase hex characters.","pattern":"^[0-9a-f]{32}$"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SaleRefund"}}}},"responses":{"200":{"description":"The answer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Sale"}}}},"400":{"description":"The amount is more than is left of the sale.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/ReadOnlyKey"},"404":{"description":"Nothing of yours with that id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"The sale is not paid, changed while it was being refunded, or its payout could not be taken back.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/Failed"}}}},"/subscriptions":{"get":{"operationId":"subscriptions.list","summary":"Subscriptions, newest first.","tags":["subscriptions"],"parameters":[{"name":"limit","in":"query","description":"How many to return, up to 100; 25 when left out.","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"name":"starting_after","in":"query","description":"The id of the last item of the page before: the answer starts after it.","schema":{"type":"string","description":"The id: 32 lowercase hex characters.","pattern":"^[0-9a-f]{32}$"}},{"name":"reference","in":"query","description":"Your own reference, as carried on the checkout link.","schema":{"type":"string"}},{"name":"buyer_email","in":"query","description":"The buyer's email address.","schema":{"type":"string"}}],"responses":{"200":{"description":"The answer.","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Subscription"}},"has_more":{"type":"boolean","description":"true when there are more to ask for."}},"required":["object","data","has_more"]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/Failed"}}}},"/subscriptions/{id}":{"get":{"operationId":"subscriptions.get","summary":"One subscription.","tags":["subscriptions"],"parameters":[{"name":"id","in":"path","required":true,"description":"The id of the object.","schema":{"type":"string","description":"The id: 32 lowercase hex characters.","pattern":"^[0-9a-f]{32}$"}}],"responses":{"200":{"description":"The answer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Subscription"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"description":"Nothing of yours with that id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/Failed"}}}},"/subscriptions/{id}/cancel":{"post":{"operationId":"subscriptions.cancel","summary":"Set a subscription to end when the period already paid for is over. It cannot be undone.","tags":["subscriptions"],"parameters":[{"name":"id","in":"path","required":true,"description":"The id of the object.","schema":{"type":"string","description":"The id: 32 lowercase hex characters.","pattern":"^[0-9a-f]{32}$"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CancelWhy"}}}},"responses":{"200":{"description":"The answer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Subscription"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/ReadOnlyKey"},"404":{"description":"Nothing of yours with that id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"The subscription has already ended.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/Failed"}}}},"/subscriptions/{id}/change":{"post":{"operationId":"subscriptions.change_plan","summary":"Move a running subscription to another of your subscription products. A dearer plan charges the difference at once; a cheaper one applies from the next renewal.","tags":["subscriptions"],"parameters":[{"name":"id","in":"path","required":true,"description":"The id of the object.","schema":{"type":"string","description":"The id: 32 lowercase hex characters.","pattern":"^[0-9a-f]{32}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanChange"}}}},"responses":{"200":{"description":"The answer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Subscription"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"description":"The payment for the new plan did not go through, so the plan was not changed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"$ref":"#/components/responses/ReadOnlyKey"},"404":{"description":"No subscription, or no plan on sale, with that id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"The subscription cannot take this now: the message says why.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/Failed"}}}},"/subscriptions/{id}/seats":{"post":{"operationId":"subscriptions.change_seats","summary":"Set how many seats a running subscription has. Seats beyond what is paid for in the period are charged at once.","tags":["subscriptions"],"parameters":[{"name":"id","in":"path","required":true,"description":"The id of the object.","schema":{"type":"string","description":"The id: 32 lowercase hex characters.","pattern":"^[0-9a-f]{32}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeatsChange"}}}},"responses":{"200":{"description":"The answer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Subscription"}}}},"400":{"description":"seats is not a whole number the product allows.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"description":"The payment for the added seats did not go through, so the seats were not changed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"$ref":"#/components/responses/ReadOnlyKey"},"404":{"description":"Nothing of yours with that id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"The subscription cannot take this now: the message says why.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/Failed"}}}},"/subscriptions/{id}/pause":{"post":{"operationId":"subscriptions.pause","summary":"Pause a monthly subscription for one to three renewals. It starts again by itself.","tags":["subscriptions"],"parameters":[{"name":"id","in":"path","required":true,"description":"The id of the object.","schema":{"type":"string","description":"The id: 32 lowercase hex characters.","pattern":"^[0-9a-f]{32}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionPause"}}}},"responses":{"200":{"description":"The answer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Subscription"}}}},"400":{"description":"months is not 1, 2 or 3.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/ReadOnlyKey"},"404":{"description":"Nothing of yours with that id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"The subscription cannot take this now: the message says why.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/Failed"}}}},"/subscriptions/{id}/resume":{"post":{"operationId":"subscriptions.resume","summary":"End a pause early.","tags":["subscriptions"],"parameters":[{"name":"id","in":"path","required":true,"description":"The id of the object.","schema":{"type":"string","description":"The id: 32 lowercase hex characters.","pattern":"^[0-9a-f]{32}$"}}],"responses":{"200":{"description":"The answer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Subscription"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/ReadOnlyKey"},"404":{"description":"Nothing of yours with that id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"The subscription is not paused.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/Failed"}}}},"/subscriptions/{id}/usage":{"post":{"operationId":"subscriptions.charge_usage","summary":"Charge a subscriber for usage at once: a number of units at the product's usage price, or at the price of the meter named.","tags":["subscriptions"],"parameters":[{"name":"id","in":"path","required":true,"description":"The id of the object.","schema":{"type":"string","description":"The id: 32 lowercase hex characters.","pattern":"^[0-9a-f]{32}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsageChargeCreate"}}}},"responses":{"200":{"description":"The answer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsageCharge"}}}},"400":{"description":"A field is missing, the meter is unknown, or the amount is too little or too much for one charge.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"description":"The payment method was refused: nothing was charged and it is not tried again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"$ref":"#/components/responses/ReadOnlyKey"},"404":{"description":"Nothing of yours with that id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"The product does not charge for usage, the subscription is paused or in a free trial, or the charge would pass the month's cap.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/Failed"}}}},"/usage_charges":{"get":{"operationId":"usage_charges.list","summary":"The charges for usage, newest first: the ones you asked for and the daily ones made from your usage events.","tags":["usage_charges"],"parameters":[{"name":"limit","in":"query","description":"How many to return, up to 100; 25 when left out.","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"name":"starting_after","in":"query","description":"The id of the last item of the page before: the answer starts after it.","schema":{"type":"string","description":"The id: 32 lowercase hex characters.","pattern":"^[0-9a-f]{32}$"}},{"name":"subscription_id","in":"query","description":"One subscription's.","schema":{"type":"string","description":"The id: 32 lowercase hex characters.","pattern":"^[0-9a-f]{32}$"}}],"responses":{"200":{"description":"The answer.","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/UsageCharge"}},"has_more":{"type":"boolean","description":"true when there are more to ask for."}},"required":["object","data","has_more"]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/Failed"}}}},"/usage_charges/{id}":{"get":{"operationId":"usage_charges.get","summary":"One usage charge.","tags":["usage_charges"],"parameters":[{"name":"id","in":"path","required":true,"description":"The id of the object.","schema":{"type":"string","description":"The id: 32 lowercase hex characters.","pattern":"^[0-9a-f]{32}$"}}],"responses":{"200":{"description":"The answer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsageCharge"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"description":"Nothing of yours with that id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/Failed"}}}},"/usage_events":{"get":{"operationId":"usage_events.list","summary":"The usage events you sent, newest first, and what became of each.","tags":["usage_events"],"parameters":[{"name":"limit","in":"query","description":"How many to return, up to 100; 25 when left out.","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"name":"starting_after","in":"query","description":"The id of the last item of the page before: the answer starts after it.","schema":{"type":"string","description":"The id: 32 lowercase hex characters.","pattern":"^[0-9a-f]{32}$"}},{"name":"reference","in":"query","description":"Your own reference, as carried on the checkout link.","schema":{"type":"string"}},{"name":"buyer_email","in":"query","description":"The buyer's email address.","schema":{"type":"string"}},{"name":"subscription_id","in":"query","description":"One subscription's.","schema":{"type":"string","description":"The id: 32 lowercase hex characters.","pattern":"^[0-9a-f]{32}$"}},{"name":"task_id","in":"query","description":"One task's.","schema":{"type":"string","description":"The id: 32 lowercase hex characters.","pattern":"^[0-9a-f]{32}$"}}],"responses":{"200":{"description":"The answer.","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/UsageEvent"}},"has_more":{"type":"boolean","description":"true when there are more to ask for."}},"required":["object","data","has_more"]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/Failed"}}},"post":{"operationId":"usage_events.record","summary":"Report usage as it happens: one event, or up to 100 in events. On a subscription the units are counted and charged once a day; on a credits account they are spent at once. Up to 600 requests a minute.","tags":["usage_events"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/UsageEventCreate"},{"$ref":"#/components/schemas/UsageEventBatch"}]}}}},"responses":{"200":{"description":"The answer.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/UsageEvent"},{"$ref":"#/components/schemas/UsageEventResults"}]}}}},"400":{"description":"A field is missing or the meter is unknown.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/ReadOnlyKey"},"404":{"description":"No task with that id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"The subscription cannot be charged for usage now, there are not enough credits, or the task is closed or would pass its budget. Nothing was counted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/Failed"}}}},"/usage_events/{id}":{"get":{"operationId":"usage_events.get","summary":"One usage event.","tags":["usage_events"],"parameters":[{"name":"id","in":"path","required":true,"description":"The id of the object.","schema":{"type":"string","description":"The id: 32 lowercase hex characters.","pattern":"^[0-9a-f]{32}$"}}],"responses":{"200":{"description":"The answer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsageEvent"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"description":"Nothing of yours with that id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/Failed"}}}},"/tasks":{"get":{"operationId":"tasks.list","summary":"The tasks you opened, newest first, each with its budget and what it has used.","tags":["tasks"],"parameters":[{"name":"limit","in":"query","description":"How many to return, up to 100; 25 when left out.","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"name":"starting_after","in":"query","description":"The id of the last item of the page before: the answer starts after it.","schema":{"type":"string","description":"The id: 32 lowercase hex characters.","pattern":"^[0-9a-f]{32}$"}},{"name":"reference","in":"query","description":"Your own reference, as carried on the checkout link.","schema":{"type":"string"}},{"name":"buyer_email","in":"query","description":"The buyer's email address.","schema":{"type":"string"}},{"name":"subscription_id","in":"query","description":"One subscription's.","schema":{"type":"string","description":"The id: 32 lowercase hex characters.","pattern":"^[0-9a-f]{32}$"}}],"responses":{"200":{"description":"The answer.","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Task"}},"has_more":{"type":"boolean","description":"true when there are more to ask for."}},"required":["object","data","has_more"]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/Failed"}}},"post":{"operationId":"tasks.open","summary":"Open a task with a budget before a piece of work starts. For a credits account the budget is held out of the balance until the task is closed. Up to 600 requests a minute.","tags":["tasks"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskOpen"}}}},"responses":{"200":{"description":"The answer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Task"}}}},"400":{"description":"A field is missing or out of range.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/ReadOnlyKey"},"409":{"description":"There are not enough credits to hold the budget, or the subscription cannot be charged for usage now.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/Failed"}}}},"/tasks/{id}":{"get":{"operationId":"tasks.get","summary":"One task.","tags":["tasks"],"parameters":[{"name":"id","in":"path","required":true,"description":"The id of the object.","schema":{"type":"string","description":"The id: 32 lowercase hex characters.","pattern":"^[0-9a-f]{32}$"}}],"responses":{"200":{"description":"The answer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Task"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"description":"Nothing of yours with that id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/Failed"}}}},"/tasks/{id}/close":{"post":{"operationId":"tasks.close","summary":"Close a task when its work is done. A credits task gives back what it held and did not use. Closing it again changes nothing.","tags":["tasks"],"parameters":[{"name":"id","in":"path","required":true,"description":"The id of the object.","schema":{"type":"string","description":"The id: 32 lowercase hex characters.","pattern":"^[0-9a-f]{32}$"}}],"responses":{"200":{"description":"The answer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Task"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/ReadOnlyKey"},"404":{"description":"Nothing of yours with that id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/Failed"}}}},"/credits":{"get":{"operationId":"credits.get","summary":"A buyer's prepaid credits with you: the balance and the last entries.","tags":["credits"],"parameters":[{"name":"reference","in":"query","description":"Your own reference, as carried on the checkout link.","schema":{"type":"string"}},{"name":"buyer_email","in":"query","description":"The buyer's email address.","schema":{"type":"string"}}],"responses":{"200":{"description":"The answer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditBalance"}}}},"400":{"description":"Neither reference nor buyer_email was given.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/Failed"}}}},"/credits/use":{"post":{"operationId":"credits.use","summary":"Spend a buyer's credits. Never takes the balance below nothing.","tags":["credits"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditsUse"}}}},"responses":{"200":{"description":"The answer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditSpend"}}}},"400":{"description":"amount is not a whole number, or nobody was named.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/ReadOnlyKey"},"409":{"description":"There are not enough credits. Nothing was spent.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/Failed"}}}},"/credits/grant":{"post":{"operationId":"credits.grant","summary":"Give a buyer credits outside a sale.","tags":["credits"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditsGrant"}}}},"responses":{"200":{"description":"The answer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditGrant"}}}},"400":{"description":"amount is not a whole number, or nobody was named.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/ReadOnlyKey"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/Failed"}}}},"/credits/alert":{"post":{"operationId":"credits.set_alert","summary":"Set the balance at which your webhook addresses are told a buyer's credits are running low.","tags":["credits"],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditAlertSet"}}}},"responses":{"200":{"description":"The answer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditAlert"}}}},"400":{"description":"at is not a whole number.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/ReadOnlyKey"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/Failed"}}}},"/discount_codes":{"get":{"operationId":"discount_codes.list","summary":"Your discount codes, newest first, up to 200.","tags":["discount_codes"],"responses":{"200":{"description":"The answer.","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/DiscountCode"}},"has_more":{"type":"boolean","description":"true when there are more to ask for."}},"required":["object","data","has_more"]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/Failed"}}},"post":{"operationId":"discount_codes.create","summary":"Add a discount code. It works at once.","tags":["discount_codes"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DiscountCodeCreate"}}}},"responses":{"201":{"description":"Made.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DiscountCode"}}}},"400":{"description":"A field is missing or not allowed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/ReadOnlyKey"},"404":{"description":"No product with that id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"The business has a code of that name.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/Failed"}}}},"/partners":{"get":{"operationId":"partners.list","summary":"The people and companies you share sales with, newest first, up to 200.","tags":["partners"],"responses":{"200":{"description":"The answer.","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Partner"}},"has_more":{"type":"boolean","description":"true when there are more to ask for."}},"required":["object","data","has_more"]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/Failed"}}},"post":{"operationId":"partners.create","summary":"Add a partner. Recvd emails it a private link to its own page, where it sets up its payouts. Not in a test business.","tags":["partners"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PartnerCreate"}}}},"responses":{"201":{"description":"Made.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Partner"}}}},"400":{"description":"A field is missing or not allowed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/ReadOnlyKey"},"409":{"description":"The business has a partner with that email, has no merchant of record terms on record yet, or is a test business.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/Failed"}}}},"/partners/{id}/split":{"post":{"operationId":"partners.set_split","summary":"Give a partner a share of every sale of a product from now on.","tags":["partners"],"parameters":[{"name":"id","in":"path","required":true,"description":"The id of the object.","schema":{"type":"string","description":"The id: 32 lowercase hex characters.","pattern":"^[0-9a-f]{32}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PartnerSplit"}}}},"responses":{"200":{"description":"The answer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Partner"}}}},"400":{"description":"The partners of one product can share at most 90% between them.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/ReadOnlyKey"},"404":{"description":"Nothing of yours with that id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"A test business has no partners.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/Failed"}}}},"/partners/{id}/stop":{"post":{"operationId":"partners.stop","summary":"End a partner: no share of any sale from now on. What it is already owed is still paid. It cannot be undone.","tags":["partners"],"parameters":[{"name":"id","in":"path","required":true,"description":"The id of the object.","schema":{"type":"string","description":"The id: 32 lowercase hex characters.","pattern":"^[0-9a-f]{32}$"}}],"responses":{"200":{"description":"The answer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Partner"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/ReadOnlyKey"},"404":{"description":"Nothing of yours with that id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"A test business has no partners.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/Failed"}}}},"/partners/{id}/approve":{"post":{"operationId":"partners.approve","summary":"Say yes to someone who asked on your affiliate sign-up page.","tags":["partners"],"parameters":[{"name":"id","in":"path","required":true,"description":"The id of the object.","schema":{"type":"string","description":"The id: 32 lowercase hex characters.","pattern":"^[0-9a-f]{32}$"}}],"responses":{"200":{"description":"The answer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Partner"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/ReadOnlyKey"},"404":{"description":"Nothing of yours with that id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"The request has already been answered, or this is a test business, which has no partners.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/Failed"}}}},"/partners/{id}/decline":{"post":{"operationId":"partners.decline","summary":"Say no to someone who asked on your affiliate sign-up page. The request is removed.","tags":["partners"],"parameters":[{"name":"id","in":"path","required":true,"description":"The id of the object.","schema":{"type":"string","description":"The id: 32 lowercase hex characters.","pattern":"^[0-9a-f]{32}$"}}],"responses":{"200":{"description":"The answer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeletedPartner"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/ReadOnlyKey"},"404":{"description":"Nothing of yours with that id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"The request has already been answered, or this is a test business, which has no partners.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/Failed"}}}},"/license_keys/{key}":{"get":{"operationId":"license_keys.get","summary":"One licence key of yours: whether it is still valid, and the installs it is in use on.","tags":["license_keys"],"parameters":[{"name":"key","in":"path","required":true,"description":"The licence key, as the buyer was sent it.","schema":{"type":"string","pattern":"^[A-Z0-9-]{10,40}$"}}],"responses":{"200":{"description":"The answer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LicenseKey"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"description":"Nothing of yours with that id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/Failed"}}}},"/license_keys/{key}/activate":{"post":{"operationId":"license_keys.activate","summary":"Put a key to use on an install. Asking again for the same install changes nothing.","tags":["license_keys"],"parameters":[{"name":"key","in":"path","required":true,"description":"The licence key, as the buyer was sent it.","schema":{"type":"string","pattern":"^[A-Z0-9-]{10,40}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LicenseInstance"}}}},"responses":{"200":{"description":"The answer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LicenseKey"}}}},"400":{"description":"instance is missing or too long.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/ReadOnlyKey"},"404":{"description":"Nothing of yours with that id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"The key is in use on every install it allows, or is not valid now.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/Failed"}}}},"/license_keys/{key}/deactivate":{"post":{"operationId":"license_keys.deactivate","summary":"Take a key off an install, which frees a place.","tags":["license_keys"],"parameters":[{"name":"key","in":"path","required":true,"description":"The licence key, as the buyer was sent it.","schema":{"type":"string","pattern":"^[A-Z0-9-]{10,40}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LicenseInstance"}}}},"responses":{"200":{"description":"The answer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LicenseKey"}}}},"400":{"description":"instance is missing or too long.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/ReadOnlyKey"},"404":{"description":"Nothing of yours with that id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/Failed"}}}},"/disputes":{"get":{"operationId":"disputes.list","summary":"The sales your buyers' banks have disputed, newest first.","tags":["disputes"],"parameters":[{"name":"limit","in":"query","description":"How many to return, up to 100; 25 when left out.","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"name":"starting_after","in":"query","description":"The id of the last dispute of the page before: the answer starts after it.","schema":{"type":"string","pattern":"^[A-Za-z0-9_]{3,80}$"}}],"responses":{"200":{"description":"The answer.","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Dispute"}},"has_more":{"type":"boolean","description":"true when there are more to ask for."}},"required":["object","data","has_more"]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/Failed"}}}},"/disputes/{dispute_id}":{"get":{"operationId":"disputes.get","summary":"One dispute, with Recvd's record of the sale.","tags":["disputes"],"parameters":[{"name":"dispute_id","in":"path","required":true,"description":"The id of the dispute.","schema":{"type":"string","pattern":"^[A-Za-z0-9_]{3,80}$"}}],"responses":{"200":{"description":"The answer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Dispute"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"description":"Nothing of yours with that id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/Failed"}}}},"/disputes/{dispute_id}/note":{"post":{"operationId":"disputes.note","summary":"Say what happened with a disputed sale. Recvd answers the bank; a key can neither draft nor send the answer.","tags":["disputes"],"parameters":[{"name":"dispute_id","in":"path","required":true,"description":"The id of the dispute.","schema":{"type":"string","pattern":"^[A-Za-z0-9_]{3,80}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DisputeNote"}}}},"responses":{"200":{"description":"The answer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Dispute"}}}},"400":{"description":"note is missing or too long.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/ReadOnlyKey"},"404":{"description":"Nothing of yours with that id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"The dispute has already been answered or closed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/Failed"}}}},"/disputes/{dispute_id}/proof":{"post":{"operationId":"disputes.proof","summary":"Add your own records to an open dispute. They are sent to the buyer's bank with Recvd's answer.","tags":["disputes"],"parameters":[{"name":"dispute_id","in":"path","required":true,"description":"The id of the dispute.","schema":{"type":"string","pattern":"^[A-Za-z0-9_]{3,80}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DisputeProof"}}}},"responses":{"200":{"description":"The answer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Dispute"}}}},"400":{"description":"A record is missing or not written as it should be, or sale_id is not a sale listed on the dispute.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/ReadOnlyKey"},"404":{"description":"Nothing of yours with that id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"The dispute has already been answered or closed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/Failed"}}}},"/portal":{"get":{"operationId":"portal.get","summary":"Everything one buyer has with you: subscriptions and what the buyer may do with each, payments, and credits.","tags":["portal"],"parameters":[{"name":"reference","in":"query","description":"Your own reference, as carried on the checkout link.","schema":{"type":"string"}},{"name":"buyer_email","in":"query","description":"The buyer's email address.","schema":{"type":"string"}}],"responses":{"200":{"description":"The answer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Portal"}}}},"400":{"description":"Neither reference nor buyer_email was given.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/Failed"}}}},"/portal/{subscription_id}/link":{"post":{"operationId":"portal.link","summary":"The buyer's own link to their subscription page. Give it only to that buyer.","tags":["portal"],"parameters":[{"name":"subscription_id","in":"path","required":true,"description":"The id of the subscription.","schema":{"type":"string","description":"The id: 32 lowercase hex characters.","pattern":"^[0-9a-f]{32}$"}}],"responses":{"200":{"description":"The answer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalLink"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/ReadOnlyKey"},"404":{"description":"Nothing of yours with that id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/Failed"}}}},"/portal/{subscription_id}/cancel":{"post":{"operationId":"portal.cancel","summary":"Cancel for the buyer: the subscription ends when the period paid for is over. It cannot be undone.","tags":["portal"],"parameters":[{"name":"subscription_id","in":"path","required":true,"description":"The id of the subscription.","schema":{"type":"string","description":"The id: 32 lowercase hex characters.","pattern":"^[0-9a-f]{32}$"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CancelWhy"}}}},"responses":{"200":{"description":"The answer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalSubscription"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/ReadOnlyKey"},"404":{"description":"Nothing of yours with that id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"The subscription has already ended.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/Failed"}}}},"/portal/{subscription_id}/reason":{"post":{"operationId":"portal.reason","summary":"Say why a cancelled subscription was cancelled. The first answer stands.","tags":["portal"],"parameters":[{"name":"subscription_id","in":"path","required":true,"description":"The id of the subscription.","schema":{"type":"string","description":"The id: 32 lowercase hex characters.","pattern":"^[0-9a-f]{32}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalReason"}}}},"responses":{"200":{"description":"The answer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalSubscription"}}}},"400":{"description":"reason is not one of the list.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/ReadOnlyKey"},"404":{"description":"Nothing of yours with that id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"The subscription has not been cancelled.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/Failed"}}}},"/portal/{subscription_id}/change":{"post":{"operationId":"portal.change_plan","summary":"Move the buyer to another plan of the same plan group.","tags":["portal"],"parameters":[{"name":"subscription_id","in":"path","required":true,"description":"The id of the subscription.","schema":{"type":"string","description":"The id: 32 lowercase hex characters.","pattern":"^[0-9a-f]{32}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanChange"}}}},"responses":{"200":{"description":"The answer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalSubscription"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"description":"The payment for the new plan did not go through, so the plan was not changed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"$ref":"#/components/responses/ReadOnlyKey"},"404":{"description":"Nothing of yours with that id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"The subscription cannot take this now: the message says why.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/Failed"}}}},"/portal/{subscription_id}/seats":{"post":{"operationId":"portal.change_seats","summary":"Set the buyer's seats.","tags":["portal"],"parameters":[{"name":"subscription_id","in":"path","required":true,"description":"The id of the subscription.","schema":{"type":"string","description":"The id: 32 lowercase hex characters.","pattern":"^[0-9a-f]{32}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeatsChange"}}}},"responses":{"200":{"description":"The answer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalSubscription"}}}},"400":{"description":"seats is not a whole number the product allows.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"description":"The payment for the added seats did not go through, so the seats were not changed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"$ref":"#/components/responses/ReadOnlyKey"},"404":{"description":"Nothing of yours with that id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"The subscription cannot take this now: the message says why.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/Failed"}}}},"/portal/{subscription_id}/pause":{"post":{"operationId":"portal.pause","summary":"Pause for the buyer, where you let subscribers pause by themselves.","tags":["portal"],"parameters":[{"name":"subscription_id","in":"path","required":true,"description":"The id of the subscription.","schema":{"type":"string","description":"The id: 32 lowercase hex characters.","pattern":"^[0-9a-f]{32}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionPause"}}}},"responses":{"200":{"description":"The answer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalSubscription"}}}},"400":{"description":"months is not 1, 2 or 3.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"You have not allowed subscribers to pause, or the key can only read.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Nothing of yours with that id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"The subscription cannot take this now: the message says why.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/Failed"}}}},"/portal/{subscription_id}/resume":{"post":{"operationId":"portal.resume","summary":"End the buyer's pause early.","tags":["portal"],"parameters":[{"name":"subscription_id","in":"path","required":true,"description":"The id of the subscription.","schema":{"type":"string","description":"The id: 32 lowercase hex characters.","pattern":"^[0-9a-f]{32}$"}}],"responses":{"200":{"description":"The answer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalSubscription"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/ReadOnlyKey"},"404":{"description":"Nothing of yours with that id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"The subscription is not paused.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/Failed"}}}},"/portal/{subscription_id}/lower_price":{"post":{"operationId":"portal.lower_price","summary":"The buyer keeps the plan at the lower price you offer before a cancellation. Send the terms as the buyer was shown them.","tags":["portal"],"parameters":[{"name":"subscription_id","in":"path","required":true,"description":"The id of the subscription.","schema":{"type":"string","description":"The id: 32 lowercase hex characters.","pattern":"^[0-9a-f]{32}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalOfferTake"}}}},"responses":{"200":{"description":"The answer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalSubscription"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/ReadOnlyKey"},"404":{"description":"Nothing of yours with that id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"There is no lower price on offer, or the terms sent are not what is on offer now. Nothing was taken.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/Failed"}}}},"/portal/offers":{"post":{"operationId":"portal.set_offers","summary":"Choose what a subscriber is shown when they press cancel.","tags":["portal"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CancelOffersSet"}}}},"responses":{"200":{"description":"The answer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CancelOffers"}}}},"400":{"description":"A field is missing or out of range.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/ReadOnlyKey"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/Failed"}}}},"/buyers":{"get":{"operationId":"buyers.list","summary":"Everyone who has bought from you, the latest to buy first, up to 200.","tags":["buyers"],"parameters":[{"name":"buyer_email","in":"query","description":"The buyer's email address.","schema":{"type":"string"}}],"responses":{"200":{"description":"The answer.","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Buyer"}},"has_more":{"type":"boolean","description":"true when there are more to ask for."}},"required":["object","data","has_more"]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/Failed"}}}},"/stats":{"get":{"operationId":"stats.get","summary":"Where your subscriptions stand today, and the last 30 days of sales in US dollars.","tags":["stats"],"responses":{"200":{"description":"The answer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Stats"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/Failed"}}}},"/events":{"get":{"operationId":"events.list","summary":"Your events of the last thirty days, oldest first: the latest ones, or with after the ones made after that event.","tags":["events"],"parameters":[{"name":"after","in":"query","description":"The id of the last event you have: the answer is the events made after it. An id that is not among your kept events, because it is older than thirty days or was never yours, starts from the oldest event kept.","schema":{"type":"string","pattern":"^evt_[0-9a-f]{24}$"}},{"name":"limit","in":"query","description":"How many to return, up to 100; 25 when left out.","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}}],"responses":{"200":{"description":"The answer.","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Event"}},"has_more":{"type":"boolean","description":"true when there are more to ask for."}},"required":["object","data","has_more"]}}}},"400":{"description":"after is not written like the id of an event.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/Failed"}}}},"/checkout_links":{"post":{"operationId":"checkout_links.create","summary":"The checkout address for a product on sale, with your reference on it. Changes nothing, so any key may call it.","tags":["checkout_links"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutLinkCreate"}}}},"responses":{"200":{"description":"The answer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutLink"}}}},"400":{"description":"quantity is not a whole number the product allows.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"description":"No product on sale with that id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/Failed"}}}}},"webhooks":{"sale.paid":{"post":{"operationId":"webhooks.sale.paid","summary":"A sale was paid: a one-time purchase, a subscription's first period, a renewal or a charge for usage.","security":[],"description":"Sent to each webhook address of the business, usually within a minute. Answer with any 2xx within eight seconds. Anything else is tried again after 1 min, 5 min, 30 min, 2 h, 6 h, 12 h, 24 h, and then marked failed. An event can arrive more than once and out of order.","parameters":[{"name":"Recvd-Signature","in":"header","required":true,"description":"t= a Unix time and v1= the HMAC-SHA256, in hex, of that time, a full stop and the raw body, keyed with the address's signing secret. Refuse an event more than five minutes old.","schema":{"type":"string","pattern":"^t=\\d+,v1=[0-9a-f]{64}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SaleEvent"}}}},"responses":{"2XX":{"description":"The event is closed."}}}},"sale.refunded":{"post":{"operationId":"webhooks.sale.refunded","summary":"A sale was refunded to the buyer, in full or in part, or a dispute on it was decided for the buyer.","security":[],"description":"Sent to each webhook address of the business, usually within a minute. Answer with any 2xx within eight seconds. Anything else is tried again after 1 min, 5 min, 30 min, 2 h, 6 h, 12 h, 24 h, and then marked failed. An event can arrive more than once and out of order.","parameters":[{"name":"Recvd-Signature","in":"header","required":true,"description":"t= a Unix time and v1= the HMAC-SHA256, in hex, of that time, a full stop and the raw body, keyed with the address's signing secret. Refuse an event more than five minutes old.","schema":{"type":"string","pattern":"^t=\\d+,v1=[0-9a-f]{64}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SaleEvent"}}}},"responses":{"2XX":{"description":"The event is closed."}}}},"sale.disputed":{"post":{"operationId":"webhooks.sale.disputed","summary":"The buyer disputed the charge with their card issuer. The sale is held until the issuer decides.","security":[],"description":"Sent to each webhook address of the business, usually within a minute. Answer with any 2xx within eight seconds. Anything else is tried again after 1 min, 5 min, 30 min, 2 h, 6 h, 12 h, 24 h, and then marked failed. An event can arrive more than once and out of order.","parameters":[{"name":"Recvd-Signature","in":"header","required":true,"description":"t= a Unix time and v1= the HMAC-SHA256, in hex, of that time, a full stop and the raw body, keyed with the address's signing secret. Refuse an event more than five minutes old.","schema":{"type":"string","pattern":"^t=\\d+,v1=[0-9a-f]{64}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SaleEvent"}}}},"responses":{"2XX":{"description":"The event is closed."}}}},"sale.fraud_warning":{"post":{"operationId":"webhooks.sale.fraud_warning","summary":"The bank that issued the buyer's card has warned that the payment may be fraud. It is not a dispute and no money has moved; the sale is kept out of your payouts until it is refunded or a person at Recvd releases it.","security":[],"description":"Sent to each webhook address of the business, usually within a minute. Answer with any 2xx within eight seconds. Anything else is tried again after 1 min, 5 min, 30 min, 2 h, 6 h, 12 h, 24 h, and then marked failed. An event can arrive more than once and out of order.","parameters":[{"name":"Recvd-Signature","in":"header","required":true,"description":"t= a Unix time and v1= the HMAC-SHA256, in hex, of that time, a full stop and the raw body, keyed with the address's signing secret. Refuse an event more than five minutes old.","schema":{"type":"string","pattern":"^t=\\d+,v1=[0-9a-f]{64}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SaleEvent"}}}},"responses":{"2XX":{"description":"The event is closed."}}}},"subscription.updated":{"post":{"operationId":"webhooks.subscription.updated","summary":"A subscription became active, changed plan or seats, was paused or resumed, fell behind on payment, was cancelled or ended.","security":[],"description":"Sent to each webhook address of the business, usually within a minute. Answer with any 2xx within eight seconds. Anything else is tried again after 1 min, 5 min, 30 min, 2 h, 6 h, 12 h, 24 h, and then marked failed. An event can arrive more than once and out of order.","parameters":[{"name":"Recvd-Signature","in":"header","required":true,"description":"t= a Unix time and v1= the HMAC-SHA256, in hex, of that time, a full stop and the raw body, keyed with the address's signing secret. Refuse an event more than five minutes old.","schema":{"type":"string","pattern":"^t=\\d+,v1=[0-9a-f]{64}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionEvent"}}}},"responses":{"2XX":{"description":"The event is closed."}}}},"payout.sent":{"post":{"operationId":"webhooks.payout.sent","summary":"A payout run sent money to your bank account.","security":[],"description":"Sent to each webhook address of the business, usually within a minute. Answer with any 2xx within eight seconds. Anything else is tried again after 1 min, 5 min, 30 min, 2 h, 6 h, 12 h, 24 h, and then marked failed. An event can arrive more than once and out of order.","parameters":[{"name":"Recvd-Signature","in":"header","required":true,"description":"t= a Unix time and v1= the HMAC-SHA256, in hex, of that time, a full stop and the raw body, keyed with the address's signing secret. Refuse an event more than five minutes old.","schema":{"type":"string","pattern":"^t=\\d+,v1=[0-9a-f]{64}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PayoutEvent"}}}},"responses":{"2XX":{"description":"The event is closed."}}}},"credits.low":{"post":{"operationId":"webhooks.credits.low","summary":"A spend took a buyer's prepaid credits to the number you set, or under it. Sent each time that line is crossed.","security":[],"description":"Sent to each webhook address of the business, usually within a minute. Answer with any 2xx within eight seconds. Anything else is tried again after 1 min, 5 min, 30 min, 2 h, 6 h, 12 h, 24 h, and then marked failed. An event can arrive more than once and out of order.","parameters":[{"name":"Recvd-Signature","in":"header","required":true,"description":"t= a Unix time and v1= the HMAC-SHA256, in hex, of that time, a full stop and the raw body, keyed with the address's signing secret. Refuse an event more than five minutes old.","schema":{"type":"string","pattern":"^t=\\d+,v1=[0-9a-f]{64}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditsLowEvent"}}}},"responses":{"2XX":{"description":"The event is closed."}}}},"usage.not_charged":{"post":{"operationId":"webhooks.usage.not_charged","summary":"The daily charge closed usage you reported for a subscription without charging it.","security":[],"description":"Sent to each webhook address of the business, usually within a minute. Answer with any 2xx within eight seconds. Anything else is tried again after 1 min, 5 min, 30 min, 2 h, 6 h, 12 h, 24 h, and then marked failed. An event can arrive more than once and out of order.","parameters":[{"name":"Recvd-Signature","in":"header","required":true,"description":"t= a Unix time and v1= the HMAC-SHA256, in hex, of that time, a full stop and the raw body, keyed with the address's signing secret. Refuse an event more than five minutes old.","schema":{"type":"string","pattern":"^t=\\d+,v1=[0-9a-f]{64}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsageNotChargedEvent"}}}},"responses":{"2XX":{"description":"The event is closed."}}}},"task.budget_reached":{"post":{"operationId":"webhooks.task.budget_reached","summary":"Usage for a task was refused because it would pass the task's budget. Sent once for each task.","security":[],"description":"Sent to each webhook address of the business, usually within a minute. Answer with any 2xx within eight seconds. Anything else is tried again after 1 min, 5 min, 30 min, 2 h, 6 h, 12 h, 24 h, and then marked failed. An event can arrive more than once and out of order.","parameters":[{"name":"Recvd-Signature","in":"header","required":true,"description":"t= a Unix time and v1= the HMAC-SHA256, in hex, of that time, a full stop and the raw body, keyed with the address's signing secret. Refuse an event more than five minutes old.","schema":{"type":"string","pattern":"^t=\\d+,v1=[0-9a-f]{64}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskEvent"}}}},"responses":{"2XX":{"description":"The event is closed."}}}},"ping":{"post":{"operationId":"webhooks.ping","summary":"A test event you send from the Developers page.","security":[],"description":"Sent to each webhook address of the business, usually within a minute. Answer with any 2xx within eight seconds. Anything else is tried again after 1 min, 5 min, 30 min, 2 h, 6 h, 12 h, 24 h, and then marked failed. An event can arrive more than once and out of order.","parameters":[{"name":"Recvd-Signature","in":"header","required":true,"description":"t= a Unix time and v1= the HMAC-SHA256, in hex, of that time, a full stop and the raw body, keyed with the address's signing secret. Refuse an event more than five minutes old.","schema":{"type":"string","pattern":"^t=\\d+,v1=[0-9a-f]{64}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PingEvent"}}}},"responses":{"2XX":{"description":"The event is closed."}}}}},"components":{"responses":{"Unauthorized":{"description":"The key is missing, wrong or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"ReadOnlyKey":{"description":"The key can only read. Make a key that may write on the Developers page.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"TooManyRequests":{"description":"Too many requests in a minute. Wait and try again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"Failed":{"description":"Recvd could not complete the request. Try again; a write with an idempotency_key is safe to repeat.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","description":"An API key from the Developers page: rk_ and 64 hex characters. A key belongs to one business, real or test."}},"schemas":{"ApiError":{"type":"object","description":"Every answer that is not in the 200s.","properties":{"error":{"type":"string","description":"What went wrong, in words."}},"required":["error"]},"Product":{"type":"object","properties":{"id":{"type":"string","description":"The id: 32 lowercase hex characters.","pattern":"^[0-9a-f]{32}$"},"object":{"const":"product"},"name":{"type":"string"},"description":{"type":"string"},"price_cents":{"type":"integer","description":"The price before tax, in the smallest unit of the currency. 0 for a product with no monthly fee."},"currency":{"type":"string","description":"The currency, as a three-letter code in lowercase.","enum":["usd","eur","gbp","cad","aud","nzd","sgd","hkd","chf","sek","nok","dkk","pln","czk","mxn"]},"billed":{"type":"string","description":"How often it is charged.","enum":["once","month","year"]},"credits":{"type":"integer","description":"Prepaid credits each sale of it adds to the buyer's account."},"max_quantity":{"type":"integer","description":"The most one buyer may buy at one checkout: units of a one-time product, seats of a subscription. 1 when the buyer is not asked."},"key_activations":{"type":"integer","description":"The installs one licence key allows, for each one bought or each seat; 0 when installs are not counted."},"pay_what_you_want":{"type":"boolean","description":"true when the buyer chooses the price, from price_cents up."},"usage_cents":{"type":"integer","description":"The price of one unit of usage on a subscription; 0 for none."},"usage_unit":{"type":["string","null"],"description":"What a unit of usage is called."},"usage_cap_cents":{"type":"integer","description":"The most one subscription is charged for usage in a calendar month (UTC); 0 for no cap."},"meters":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","description":"The name an event or a charge names the meter by."},"unit":{"type":"string","description":"What a unit is called, for example: 1,000 output tokens."},"cents":{"type":"integer","description":"The price of one unit, in the smallest unit of the product's currency."},"credits":{"type":"integer","description":"Prepaid credits one unit adds when its charge is paid; 0 for none."},"topup_at":{"type":["integer","null"],"description":"The balance at which one unit is charged by itself; null when it is charged only on request."}},"required":["key","unit","cents","credits","topup_at"]},"description":"More kinds of usage the product prices."},"question":{"type":["string","null"],"description":"The question each buyer is asked at checkout."},"question_required":{"type":"boolean"},"status":{"type":"string","description":"Where the product stands.","enum":["on_sale","in_review","not_approved","off_sale"]},"checkout_url":{"type":["string","null"],"description":"The checkout address; null while the product is not on sale.","format":"uri"},"created_at":{"type":"string","description":"When it was made, in UTC.","format":"date-time"}},"required":["id","object","name","description","price_cents","currency","billed","credits","max_quantity","key_activations","pay_what_you_want","usage_cents","usage_unit","usage_cap_cents","meters","question","question_required","status","checkout_url","created_at"]},"Sale":{"type":"object","properties":{"id":{"type":"string","description":"The id: 32 lowercase hex characters.","pattern":"^[0-9a-f]{32}$"},"object":{"const":"sale"},"product_id":{"type":"string","description":"The product sold.","pattern":"^[0-9a-f]{32}$"},"subscription_id":{"type":["string","null"],"description":"The subscription this sale is a payment of.","pattern":"^[0-9a-f]{32}$"},"reference":{"type":["string","null"],"description":"Your own reference, from the checkout link."},"buyer_email":{"type":"string"},"buyer_name":{"type":"string"},"buyer_country":{"type":"string","description":"Two-letter country code."},"quantity":{"type":"integer","description":"How many were bought; the amounts are for all of them."},"usage_quantity":{"type":["integer","null"],"description":"For a charge for usage: how many units it was for. null for every other sale."},"answer":{"type":["string","null"],"description":"What the buyer answered to the product's question."},"subtotal_cents":{"type":"integer","description":"Your price, in US cents: what the payment became once converted."},"tax_cents":{"type":"integer","description":"Sales tax, in US cents. It is never yours."},"fee_cents":{"type":"integer","description":"Recvd's fee, in US cents."},"reserve_cents":{"type":"integer","description":"The reserve held on the sale, in US cents."},"currency":{"const":"usd"},"buyer_currency":{"type":"string","description":"The currency, as a three-letter code in lowercase.","enum":["usd","eur","gbp","cad","aud","nzd","sgd","hkd","chf","sek","nok","dkk","pln","czk","mxn"]},"buyer_subtotal_cents":{"type":"integer","description":"What the buyer paid before tax, in buyer_currency."},"buyer_tax_cents":{"type":"integer","description":"The tax the buyer paid, in buyer_currency."},"payment_method":{"type":["string","null"],"description":"How the buyer paid, in the payment partner's name for it: card, us_bank_account, crypto and so on."},"buyer_company":{"type":["string","null"]},"buyer_tax_id":{"type":["string","null"]},"invoice_url":{"type":["string","null"],"description":"The buyer's invoice as a PDF. Anyone with the link can download it.","format":"uri"},"partner_cents":{"type":"integer","description":"What your partners get from this sale between them, in US cents."},"affiliate_id":{"type":["string","null"],"description":"The partner whose link the buyer came through.","pattern":"^[0-9a-f]{32}$"},"status":{"type":"string","description":"A part refund leaves the sale paid, at lower amounts.","enum":["paid","refunded","disputed"]},"paid_on":{"type":["string","null"],"description":"The day it was paid. As YYYY-MM-DD.","format":"date"},"paid_out_on":{"type":["string","null"],"description":"The day it was paid out. As YYYY-MM-DD.","format":"date"},"refunded_on":{"type":["string","null"],"description":"The day it was refunded. As YYYY-MM-DD.","format":"date"},"refunded_cents":{"type":"integer","description":"How much of the price has gone back, in US cents."},"buyer_refunded_cents":{"type":"integer","description":"What the buyer got back, tax included, in buyer_currency."},"created_at":{"type":"string","description":"When it was made, in UTC.","format":"date-time"}},"required":["id","object","product_id","subscription_id","reference","buyer_email","buyer_name","buyer_country","quantity","usage_quantity","answer","subtotal_cents","tax_cents","fee_cents","reserve_cents","currency","buyer_currency","buyer_subtotal_cents","buyer_tax_cents","payment_method","buyer_company","buyer_tax_id","invoice_url","partner_cents","affiliate_id","status","paid_on","paid_out_on","refunded_on","refunded_cents","buyer_refunded_cents","created_at"]},"Subscription":{"type":"object","properties":{"id":{"type":"string","description":"The id: 32 lowercase hex characters.","pattern":"^[0-9a-f]{32}$"},"object":{"const":"subscription"},"product_id":{"type":"string","description":"The plan it is on.","pattern":"^[0-9a-f]{32}$"},"reference":{"type":["string","null"]},"buyer_email":{"type":"string"},"buyer_name":{"type":"string"},"buyer_country":{"type":"string"},"quantity":{"type":"integer","description":"Seats: each period is charged this many times the price."},"answer":{"type":["string","null"]},"status":{"type":"string","description":"paused is between paused_from and paused_until.","enum":["active","past_due","canceled","paused"]},"renews_on":{"type":["string","null"],"description":"The day of the next charge. As YYYY-MM-DD.","format":"date"},"trial_ends_on":{"type":["string","null"],"description":"The day of the first charge after a free trial. As YYYY-MM-DD.","format":"date"},"paused_from":{"type":["string","null"],"description":"The first day of a pause. As YYYY-MM-DD.","format":"date"},"paused_until":{"type":["string","null"],"description":"The day it is next charged after a pause. As YYYY-MM-DD.","format":"date"},"cancel_requested_on":{"type":["string","null"],"description":"The day it was set to end. As YYYY-MM-DD.","format":"date"},"cancel_reason":{"type":["string","null"],"description":"Why the buyer cancelled, when they said.","enum":["too_expensive","not_using","missing","switched","done","other"]},"cancel_note":{"type":["string","null"],"description":"The buyer's own words on why they cancelled."},"created_at":{"type":"string","description":"When it was made, in UTC.","format":"date-time"}},"required":["id","object","product_id","reference","buyer_email","buyer_name","buyer_country","quantity","answer","status","renews_on","trial_ends_on","paused_from","paused_until","cancel_requested_on","cancel_reason","cancel_note","created_at"]},"UsageCharge":{"type":"object","properties":{"object":{"const":"usage_charge"},"id":{"type":"string","description":"The id: 32 lowercase hex characters.","pattern":"^[0-9a-f]{32}$"},"subscription_id":{"type":"string","description":"The id: 32 lowercase hex characters.","pattern":"^[0-9a-f]{32}$"},"quantity":{"type":"integer","description":"Units charged for."},"amount_cents":{"type":"integer","description":"In the smallest unit of currency."},"currency":{"type":"string","description":"The currency, as a three-letter code in lowercase.","enum":["usd","eur","gbp","cad","aud","nzd","sgd","hkd","chf","sek","nok","dkk","pln","czk","mxn"]},"status":{"type":"string","description":"pending: the buyer was charged and the sale is being recorded. paid: the sale is recorded. failed: the payment method was refused and nothing was charged.","enum":["pending","paid","failed"]},"sale_id":{"type":["string","null"],"description":"The sale, once it is recorded.","pattern":"^[0-9a-f]{32}$"},"meter":{"type":["string","null"],"description":"The meter the charge is for; null for the product's own usage price."},"memo":{"type":["string","null"]},"created_at":{"type":"string","description":"When it was made, in UTC.","format":"date-time"}},"required":["object","id","subscription_id","quantity","amount_cents","currency","status","sale_id","meter","memo","created_at"]},"UsageEvent":{"type":"object","properties":{"object":{"const":"usage_event"},"id":{"type":"string","description":"The id: 32 lowercase hex characters.","pattern":"^[0-9a-f]{32}$"},"subscription_id":{"type":["string","null"],"description":"The id: 32 lowercase hex characters.","pattern":"^[0-9a-f]{32}$"},"account":{"type":["string","null"],"description":"The credits account, for an event that spent credits."},"quantity":{"type":"integer","description":"Units used."},"status":{"type":"string","description":"counted: waiting for the day's charge. charged: in the usage charge named by usage_charge_id. spent: taken from the account's credits. not_charged: closed without a charge.","enum":["counted","charged","spent","not_charged"]},"usage_charge_id":{"type":["string","null"],"description":"The id: 32 lowercase hex characters.","pattern":"^[0-9a-f]{32}$"},"task_id":{"type":["string","null"],"description":"The task the event was counted against.","pattern":"^[0-9a-f]{32}$"},"meter":{"type":["string","null"]},"memo":{"type":["string","null"]},"created_at":{"type":"string","description":"When it was made, in UTC.","format":"date-time"},"balance":{"type":"integer","description":"The credits left, on the answer to an event that spent credits."}},"required":["object","id","subscription_id","account","quantity","status","usage_charge_id","task_id","meter","memo","created_at"]},"Task":{"type":"object","properties":{"object":{"const":"task"},"id":{"type":"string","description":"The id: 32 lowercase hex characters.","pattern":"^[0-9a-f]{32}$"},"subscription_id":{"type":["string","null"],"description":"The id: 32 lowercase hex characters.","pattern":"^[0-9a-f]{32}$"},"account":{"type":["string","null"]},"budget":{"type":"integer","description":"The most the task may use: credits for a credits account, money in the smallest unit of the product's currency for a subscription."},"used":{"type":"integer"},"remaining":{"type":"integer"},"status":{"type":"string","enum":["open","closed"]},"memo":{"type":["string","null"]},"created_at":{"type":"string","description":"When it was made, in UTC.","format":"date-time"},"expires_at":{"type":["string","null"],"description":"When the task ends by itself.","format":"date-time"},"closed_at":{"type":["string","null"],"description":"When it was closed.","format":"date-time"}},"required":["object","id","subscription_id","account","budget","used","remaining","status","memo","created_at","expires_at","closed_at"]},"Partner":{"type":"object","properties":{"id":{"type":"string","description":"The id: 32 lowercase hex characters.","pattern":"^[0-9a-f]{32}$"},"object":{"const":"partner"},"name":{"type":"string"},"email":{"type":"string"},"country":{"type":"string"},"kind":{"type":"string","enum":["person","company"]},"status":{"type":"string","description":"pending asked on your affiliate sign-up page and waits for your answer; stopped gets no share of new sales.","enum":["pending","active","stopped"]},"affiliate_percent":{"type":"number","description":"Its share of each sale that comes through its link."},"affiliate_code":{"type":["string","null"],"description":"The code its link carries as ?aff=."},"splits":{"type":"array","items":{"type":"object","properties":{"product_id":{"type":"string","description":"The id: 32 lowercase hex characters.","pattern":"^[0-9a-f]{32}$"},"percent":{"type":"number"}},"required":["product_id","percent"]}},"payouts_started":{"type":"boolean","description":"Whether it has begun giving the payment partner its payout details."},"earned_cents":{"type":"integer","description":"Its shares of standing sales, in US cents."},"created_at":{"type":"string","description":"When it was made, in UTC.","format":"date-time"}},"required":["id","object","name","email","country","kind","status","affiliate_percent","affiliate_code","splits","payouts_started","earned_cents","created_at"]},"DeletedPartner":{"type":"object","description":"A request that was declined is gone.","properties":{"id":{"type":"string","description":"The id: 32 lowercase hex characters.","pattern":"^[0-9a-f]{32}$"},"object":{"const":"partner"},"deleted":{"const":true}},"required":["id","object","deleted"]},"DiscountCode":{"type":"object","properties":{"id":{"type":"string","description":"The id: 32 lowercase hex characters.","pattern":"^[0-9a-f]{32}$"},"object":{"const":"discount_code"},"code":{"type":"string"},"percent_off":{"type":"integer"},"product_id":{"type":["string","null"],"description":"The one product it works for; null for every product.","pattern":"^[0-9a-f]{32}$"},"max_uses":{"type":["integer","null"]},"ends_on":{"type":["string","null"],"description":"The last day it works. As YYYY-MM-DD.","format":"date"},"active":{"type":"boolean"},"created_at":{"type":"string","description":"When it was made, in UTC.","format":"date-time"}},"required":["id","object","code","percent_off","product_id","max_uses","ends_on","active","created_at"]},"Buyer":{"type":"object","properties":{"object":{"const":"buyer"},"email":{"type":"string"},"name":{"type":"string"},"country":{"type":"string"},"sales":{"type":"integer","description":"Sales that stand."},"paid_cents":{"type":"integer","description":"What those came to before tax, in US cents."},"currency":{"const":"usd"},"refunded_sales":{"type":"integer"},"first_paid_on":{"type":["string","null"],"description":"The first purchase. As YYYY-MM-DD.","format":"date"},"last_paid_on":{"type":["string","null"],"description":"The last purchase. As YYYY-MM-DD.","format":"date"},"subscriptions_running":{"type":"integer"}},"required":["object","email","name","country","sales","paid_cents","currency","refunded_sales","first_paid_on","last_paid_on","subscriptions_running"]},"Stats":{"type":"object","properties":{"object":{"const":"stats"},"as_of":{"type":"string","description":"The day the figures are for. As YYYY-MM-DD.","format":"date"},"subscriptions":{"type":"object","properties":{"running":{"type":"integer"},"in_trial":{"type":"integer"},"paused":{"type":"integer"},"past_due":{"type":"integer"},"ending":{"type":"integer"},"ended":{"type":"integer"},"started_last_30_days":{"type":"integer"},"billed_each_month":{"type":"array","description":"What the running ones bill each month, by currency. Never converted or added across currencies.","items":{"type":"object","properties":{"currency":{"type":"string"},"cents":{"type":"integer"}},"required":["currency","cents"]}}},"required":["running","in_trial","paused","past_due","ending","ended","started_last_30_days","billed_each_month"]},"sales_last_30_days":{"type":"object","properties":{"count":{"type":"integer"},"sold_cents":{"type":"integer"},"refunded":{"type":"integer"},"currency":{"const":"usd"}},"required":["count","sold_cents","refunded","currency"]}},"required":["object","as_of","subscriptions","sales_last_30_days"]},"CreditBalance":{"type":"object","properties":{"object":{"const":"credit_balance"},"account":{"type":"string","description":"The reference, or the buyer's email."},"balance":{"type":"integer","description":"Credits left."},"entries":{"type":"array","description":"The last 25 entries, newest first.","items":{"type":"object","properties":{"amount":{"type":"integer","description":"Positive for credits added, negative for credits spent or taken back."},"kind":{"type":"string","enum":["grant","use","return"]},"memo":{"type":["string","null"]},"sale_id":{"type":["string","null"],"description":"The id: 32 lowercase hex characters.","pattern":"^[0-9a-f]{32}$"},"created_at":{"type":"string","description":"When it was made, in UTC.","format":"date-time"}},"required":["amount","kind","memo","sale_id","created_at"]}}},"required":["object","account","balance","entries"]},"CreditSpend":{"type":"object","properties":{"object":{"const":"credit_balance"},"account":{"type":"string"},"balance":{"type":"integer","description":"Credits left."},"used":{"type":"integer"},"repeated":{"type":"boolean","description":"true when this idempotency_key had already spent: nothing more was taken."}},"required":["object","account","balance","used","repeated"]},"CreditGrant":{"type":"object","properties":{"object":{"const":"credit_balance"},"account":{"type":"string"},"balance":{"type":"integer","description":"Credits left."},"added":{"type":"integer"}},"required":["object","account","balance","added"]},"CreditAlert":{"type":"object","properties":{"object":{"const":"credit_alert"},"at":{"type":["integer","null"],"description":"The balance at which credits.low is sent; null for no alert."}},"required":["object","at"]},"LicenseKey":{"type":"object","properties":{"object":{"const":"license_key"},"key":{"type":"string"},"product_id":{"type":"string","description":"The id: 32 lowercase hex characters.","pattern":"^[0-9a-f]{32}$"},"sale_id":{"type":["string","null"],"description":"The id: 32 lowercase hex characters.","pattern":"^[0-9a-f]{32}$"},"subscription_id":{"type":["string","null"],"description":"The id: 32 lowercase hex characters.","pattern":"^[0-9a-f]{32}$"},"status":{"type":"string","enum":["active","paused","ended","refunded"]},"valid":{"type":"boolean","description":"true while the status is active."},"activation_limit":{"type":["integer","null"],"description":"The installs the key allows; null when they are not counted."},"activations":{"type":"array","items":{"type":"object","properties":{"instance":{"type":"string"},"activated_at":{"type":"string","description":"When the install was activated.","format":"date-time"}},"required":["instance","activated_at"]}},"created_at":{"type":"string","description":"When it was made, in UTC.","format":"date-time"}},"required":["object","key","product_id","sale_id","subscription_id","status","valid","activation_limit","activations","created_at"]},"CheckoutLink":{"type":"object","properties":{"object":{"const":"checkout_link"},"url":{"type":"string","format":"uri"},"product_id":{"type":"string","description":"The id: 32 lowercase hex characters.","pattern":"^[0-9a-f]{32}$"},"reference":{"type":["string","null"]},"quantity":{"type":"integer"}},"required":["object","url","product_id","reference","quantity"]},"BatchError":{"type":"object","description":"In the answer to a list of usage events: the place of one that was refused.","properties":{"object":{"const":"error"},"status":{"type":"integer","description":"The status the event would have answered by itself."},"error":{"type":"string"}},"required":["object","status","error"]},"CancelOffers":{"type":"object","properties":{"object":{"const":"cancel_offers"},"on":{"type":"boolean","description":"Whether a subscriber who presses cancel is shown the offers first."},"percent":{"type":"integer","description":"The lower price, as a percentage off what the subscriber pays; 0 for none."},"renewals":{"type":"integer","description":"The renewals the lower price is for."}},"required":["object","on","percent","renewals"]},"PortalLink":{"type":"object","properties":{"object":{"const":"portal_link"},"subscription_id":{"type":"string","description":"The id: 32 lowercase hex characters.","pattern":"^[0-9a-f]{32}$"},"url":{"type":"string","description":"The buyer's own page. The link is the buyer's key: give it only to that buyer, and keep it out of logs.","format":"uri"}},"required":["object","subscription_id","url"]},"Portal":{"type":"object","description":"Everything one buyer has with you. It carries no portal link.","properties":{"object":{"const":"portal"},"reference":{"type":["string","null"]},"buyer_email":{"type":["string","null"]},"subscriptions":{"type":"array","items":{"$ref":"#/components/schemas/PortalSubscription"}},"sales_has_more":{"type":"boolean","description":"true when there are payments older than the 36 here; GET /sales lists them."},"sales":{"type":"array","description":"The latest 36 payments, newest first.","items":{"type":"object","properties":{"id":{"type":"string","description":"The id: 32 lowercase hex characters.","pattern":"^[0-9a-f]{32}$"},"product_id":{"type":"string","description":"The id: 32 lowercase hex characters.","pattern":"^[0-9a-f]{32}$"},"product":{"type":"string"},"subscription_id":{"type":["string","null"],"description":"The id: 32 lowercase hex characters.","pattern":"^[0-9a-f]{32}$"},"status":{"type":"string","enum":["paid","refunded","disputed"]},"paid_on":{"type":["string","null"],"description":"The day it was paid. As YYYY-MM-DD.","format":"date"},"total_cents":{"type":"integer","description":"What the buyer paid, tax included."},"currency":{"type":"string","description":"The currency, as a three-letter code in lowercase.","enum":["usd","eur","gbp","cad","aud","nzd","sgd","hkd","chf","sek","nok","dkk","pln","czk","mxn"]},"invoice_url":{"type":["string","null"],"format":"uri"},"files_url":{"type":["string","null"],"description":"The files of a one-time purchase.","format":"uri"}},"required":["id","product_id","product","subscription_id","status","paid_on","total_cents","currency","invoice_url","files_url"]}},"credits":{"type":"object","properties":{"account":{"type":"string"},"balance":{"type":"integer"}},"required":["account","balance"]}},"required":["object","reference","buyer_email","subscriptions","sales_has_more","sales","credits"]},"Dispute":{"type":"object","description":"A sale the buyer's bank has disputed. record is on one dispute, and not in a list.","properties":{"id":{"type":"string","description":"The dispute's own id, as the payment partner gave it.","pattern":"^[A-Za-z0-9_]{3,80}$"},"object":{"const":"dispute"},"sale_id":{"type":"string","description":"The sale that is disputed.","pattern":"^[0-9a-f]{32}$"},"status":{"type":"string","description":"open while the bank has not decided; won when it decided for Recvd; lost when it decided for the buyer.","enum":["open","won","lost"]},"answered":{"type":"boolean","description":"true once a person at Recvd has sent the answer to the bank. Nothing can be added after that."},"reason":{"type":"string","description":"The bank's reason."},"amount_cents":{"type":"integer","description":"What is disputed, in the smallest unit of currency."},"currency":{"type":"string","description":"The currency, as a three-letter code in lowercase.","enum":["usd","eur","gbp","cad","aud","nzd","sgd","hkd","chf","sek","nok","dkk","pln","czk","mxn"]},"respond_by":{"type":["string","null"],"description":"When the bank wants an answer by.","format":"date-time"},"network":{"type":["string","null"],"description":"The card's network, when the payment partner says."},"case_type":{"type":["string","null"],"description":"chargeback, inquiry and so on, when the payment partner says."},"prevented":{"type":"boolean","description":"true when the bank settled it before it became a dispute: there is nothing to answer."},"note":{"type":["string","null"],"description":"What you said happened."},"proof":{"$ref":"#/components/schemas/DisputeProofKept"},"record":{"$ref":"#/components/schemas/DisputeRecord"},"created_at":{"type":"string","description":"When it was opened.","format":"date-time"},"closed_on":{"type":["string","null"],"description":"The day it was decided. As YYYY-MM-DD.","format":"date"}},"required":["id","object","sale_id","status","answered","reason","amount_cents","currency","respond_by","network","case_type","prevented","note","proof","created_at","closed_on"]},"DisputeProofKept":{"type":"object","description":"The records you added.","properties":{"access_activity_log":{"type":"string"},"sales":{"type":"object","description":"Your records for the disputed sale and for earlier ones, by sale id.","additionalProperties":{"$ref":"#/components/schemas/DisputeSaleProof"}}},"required":[]},"DisputeSaleProof":{"type":"object","properties":{"customer_account_id":{"type":"string","description":"The buyer's account with you.","maxLength":200},"customer_purchase_ip":{"type":"string","description":"The IP address your site saw for the buyer."},"customer_device_id":{"type":"string","description":"The buyer's device ID.","minLength":15,"maxLength":200},"customer_device_fingerprint":{"type":"string","description":"The buyer's device fingerprint.","minLength":20,"maxLength":200}},"required":[]},"DisputeRecord":{"type":"object","description":"What Recvd already holds for the answer.","properties":{"delivery":{"type":"array","items":{"type":"string"},"description":"Dated lines: what Recvd's own record shows was delivered and used."},"earlier_sales":{"type":"array","description":"The buyer's earlier sales with you that stand and were never disputed.","items":{"type":"object","properties":{"sale_id":{"type":"string","description":"The id: 32 lowercase hex characters.","pattern":"^[0-9a-f]{32}$"},"paid_on":{"type":"string","description":"The day it was paid. As YYYY-MM-DD.","format":"date"},"amount_cents":{"type":"integer"},"currency":{"type":"string","description":"The currency, as a three-letter code in lowercase.","enum":["usd","eur","gbp","cad","aud","nzd","sgd","hkd","chf","sek","nok","dkk","pln","czk","mxn"]},"used":{"type":"boolean","description":"true for the two put to the card network's rule."}},"required":["sale_id","paid_on","amount_cents","currency","used"]}},"compelling_evidence":{"type":"object","properties":{"eligible":{"type":"boolean","description":"true when the card network's rule on earlier undisputed purchases applies to this dispute."},"ready":{"type":"boolean","description":"true when the record has what the rule asks for."},"missing":{"type":"array","items":{"type":"string"}},"partner":{"type":["object","null"],"description":"The payment partner's word, once the details were put to it.","properties":{"status":{"type":"string","description":"qualified, requires_action or not_qualified."},"required_actions":{"type":"array","items":{"type":"string"}}},"required":["status","required_actions"]}},"required":["eligible","ready","missing","partner"]}},"required":["delivery","earlier_sales","compelling_evidence"]},"DisputeNote":{"type":"object","properties":{"note":{"type":"string","description":"What happened with the sale, in your own words. It replaces the note before it.","minLength":1,"maxLength":4000}},"required":["note"]},"DisputeProof":{"type":"object","description":"Your own records. Only what is named is changed; null takes a record away. They are sent to the buyer's bank with Recvd's answer.","properties":{"sale_id":{"type":"string","description":"An earlier sale listed on the dispute. Leave it out for the disputed sale.","pattern":"^[0-9a-f]{32}$"},"access_activity_log":{"type":["string","null"],"description":"What the buyer did with the product, with dates. About the disputed sale only.","maxLength":15000},"customer_account_id":{"type":["string","null"],"description":"The buyer's account with you.","maxLength":200},"customer_purchase_ip":{"type":["string","null"],"description":"The IP address your site saw for the buyer."},"customer_device_id":{"type":["string","null"],"description":"The buyer's device ID.","minLength":15,"maxLength":200},"customer_device_fingerprint":{"type":["string","null"],"description":"The buyer's device fingerprint.","minLength":20,"maxLength":200}},"required":[]},"CancelWhy":{"type":"object","description":"A reason that is not one of these is left out, and the cancellation still goes through.","properties":{"reason":{"type":"string","description":"Why the buyer cancelled.","enum":["too_expensive","not_using","missing","switched","done","other"]},"note":{"type":"string","description":"The buyer's own words on why.","maxLength":200}},"required":[]},"PortalReason":{"type":"object","properties":{"reason":{"type":"string","description":"Why the buyer cancelled.","enum":["too_expensive","not_using","missing","switched","done","other"]},"note":{"type":"string","description":"The buyer's own words on why.","maxLength":200}},"required":["reason"]},"PortalOfferTake":{"type":"object","properties":{"price_cents":{"type":"integer","description":"The price of one seat the buyer was shown.","minimum":1},"renewals":{"type":"integer","description":"The renewals the buyer was shown.","minimum":1,"maximum":12},"then_cents":{"type":"integer","description":"The price of one seat afterwards, as the buyer was shown it.","minimum":1}},"required":["price_cents","renewals","then_cents"]},"CancelOffersSet":{"type":"object","properties":{"on":{"type":"boolean"},"percent":{"type":"integer","description":"1 to 90 percent off what the subscriber pays; 0, or left out, for no lower price.","minimum":0,"maximum":90},"renewals":{"type":"integer","description":"Needed with percent.","minimum":1,"maximum":12}},"required":["on"]},"CheckoutLinkCreate":{"type":"object","properties":{"product_id":{"type":"string","description":"A product that is on sale.","pattern":"^[0-9a-f]{32}$"},"reference":{"type":"string","description":"Your own id for the buyer; it comes back on the sale.","maxLength":200},"quantity":{"type":"integer","description":"How many the checkout starts on.","minimum":1},"lang":{"type":"string","description":"The language the checkout opens in; without it the checkout follows the buyer's browser.","enum":["en","es","fr","de","it","pt","nl"]}},"required":["product_id"]},"ProductCreate":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string","description":"What the buyer gets."},"price_cents":{"type":"integer","description":"The price before tax, in the smallest unit of the currency. 0 for a product with no monthly fee: billed month, with usage_cents or meters and a usage_cap_cents.","minimum":0},"tax_code":{"type":"string","description":"A tax code from the product form, for example txcd_10103001 (software for business use)."},"currency":{"type":"string","description":"usd when left out. It cannot be changed afterwards.","enum":["usd","eur","gbp","cad","aud","nzd","sgd","hkd","chf","sek","nok","dkk","pln","czk","mxn"]},"billed":{"type":"string","description":"once when left out.","enum":["once","month","year"]},"trial_days":{"type":"integer","description":"Free trial, for a product billed monthly or yearly.","minimum":0,"maximum":90},"license_keys":{"type":"boolean","description":"true and each buyer is sent a licence key."},"plan_group":{"type":"string","description":"Products with the same word are plans a subscriber can move between."},"credits":{"type":"integer","description":"Prepaid credits each sale of it adds to the buyer's account.","minimum":0},"max_quantity":{"type":"integer","description":"The most one buyer may buy at one checkout.","minimum":1,"maximum":1000},"key_activations":{"type":"integer","description":"Installs one licence key allows.","minimum":0,"maximum":1000},"pay_what_you_want":{"type":"boolean","description":"The buyer chooses the price, from price_cents up. A product billed once and sold one at a time."},"usage_cents":{"type":"integer","description":"For a subscription: the price of one unit of usage.","minimum":0},"usage_unit":{"type":"string","description":"What a unit of usage is called, for example: 1,000 API calls."},"usage_cap_cents":{"type":"integer","description":"The most one subscription is charged for usage in a calendar month (UTC). The checkout shows it.","minimum":0},"meters":{"type":"array","maxItems":10,"description":"For a subscription: more kinds of usage, each with its own price. They cannot be changed afterwards.","items":{"type":"object","properties":{"key":{"type":"string","description":"1 to 40 lowercase letters, digits or underscores.","pattern":"^[a-z0-9_]{1,40}$"},"unit":{"type":"string"},"cents":{"type":"integer","minimum":1},"credits":{"type":"integer","description":"Prepaid credits one unit adds when its charge is paid.","minimum":0},"topup_at":{"type":"integer","description":"The balance at which one unit is charged by itself. Needs credits and a usage_cap_cents.","minimum":0}},"required":["key","unit","cents"]}},"question":{"type":"string","description":"One question each buyer is asked at checkout. Never ask for a password, a card number or a government ID.","maxLength":120},"question_required":{"type":"boolean"}},"required":["name","description","price_cents","tax_code"]},"DiscountCodeCreate":{"type":"object","properties":{"code":{"type":"string","description":"3 to 32 letters, digits, dashes or underscores."},"percent_off":{"type":"integer","minimum":1,"maximum":99},"product_id":{"type":"string","description":"Leave out for every product.","pattern":"^[0-9a-f]{32}$"},"max_uses":{"type":"integer","minimum":1},"ends_on":{"type":"string","description":"The last day it works. As YYYY-MM-DD.","format":"date"}},"required":["code","percent_off"]},"CreditsUse":{"type":"object","description":"Say whose credits with reference or buyer_email.","properties":{"reference":{"type":"string","description":"Your own id for the buyer, as carried on the checkout link: names a credits account.","maxLength":200},"buyer_email":{"type":"string","description":"The buyer's email address: names a credits account when the checkout link carried no reference."},"amount":{"type":"integer","description":"Credits to spend.","minimum":1},"memo":{"type":"string","description":"What they were spent on.","maxLength":200},"idempotency_key":{"type":"string","description":"Your own id for this spend, up to 200 characters. A request sent twice with the same key spends once: the second answer says repeated, with the balance as it is then.","minLength":1,"maxLength":200}},"required":["amount"]},"CreditsGrant":{"type":"object","description":"Say whose credits with reference or buyer_email.","properties":{"reference":{"type":"string","description":"Your own id for the buyer, as carried on the checkout link: names a credits account.","maxLength":200},"buyer_email":{"type":"string","description":"The buyer's email address: names a credits account when the checkout link carried no reference."},"amount":{"type":"integer","description":"Credits to add.","minimum":1},"memo":{"type":"string","maxLength":200}},"required":["amount"]},"CreditAlertSet":{"type":"object","properties":{"at":{"type":["integer","null"],"description":"Told when a spend takes a buyer's credits to this many or fewer. null, or left out, for no alert.","minimum":0}},"required":[]},"PartnerCreate":{"type":"object","properties":{"name":{"type":"string"},"email":{"type":"string"},"country":{"type":"string","description":"Two-letter code of the country it is paid in; US when left out."},"kind":{"type":"string","enum":["person","company"]},"affiliate_percent":{"type":"number","description":"Share of each sale that comes through its affiliate link.","minimum":0,"maximum":90}},"required":["name","email"]},"PartnerSplit":{"type":"object","properties":{"product_id":{"type":"string","description":"The id: 32 lowercase hex characters.","pattern":"^[0-9a-f]{32}$"},"percent":{"type":"number","description":"Of the price after Recvd's fee; 0 ends it.","minimum":0,"maximum":90}},"required":["product_id","percent"]},"LicenseInstance":{"type":"object","properties":{"instance":{"type":"string","description":"Your own name for the install: a device id, a hostname, a site.","minLength":1,"maxLength":200}},"required":["instance"]},"SaleRefund":{"type":"object","properties":{"amount":{"type":"integer","description":"A part to refund: what goes back to the buyer, tax included, in the smallest unit of buyer_currency. Leave it out to refund all of it.","minimum":1}},"required":[]},"UsageEventCreate":{"type":"object","description":"Say who used it with subscription_id, with reference or buyer_email for a credits account, or with task_id.","properties":{"quantity":{"type":"integer","description":"How many units were used.","minimum":1},"idempotency_key":{"type":"string","description":"Your own id for this event, up to 180 characters. A request sent twice with the same key counts once and gets the first answer.","minLength":1,"maxLength":180},"subscription_id":{"type":"string","description":"The subscription the usage is on.","pattern":"^[0-9a-f]{32}$"},"reference":{"type":"string","description":"Your own id for the buyer, as carried on the checkout link: names a credits account.","maxLength":200},"buyer_email":{"type":"string","description":"The buyer's email address: names a credits account when the checkout link carried no reference."},"task_id":{"type":"string","description":"A task opened with POST /tasks: the event is counted against its budget. Leave out subscription_id, reference and buyer_email then.","pattern":"^[0-9a-f]{32}$"},"meter":{"type":"string","description":"For usage on a subscription whose product has meters: the key of the meter."},"memo":{"type":"string","maxLength":200}},"required":["quantity","idempotency_key"]},"UsageEventBatch":{"type":"object","description":"Up to a hundred events in one request. Each is counted or refused by itself. Where events is there, nothing else in the body is read.","properties":{"events":{"type":"array","minItems":1,"maxItems":100,"items":{"$ref":"#/components/schemas/UsageEventCreate"}}},"required":["events"]},"UsageEventResults":{"type":"object","description":"The answer to a list of usage events: each one's answer in its place.","properties":{"object":{"const":"list"},"data":{"type":"array","items":{"oneOf":[{"$ref":"#/components/schemas/UsageEvent"},{"$ref":"#/components/schemas/BatchError"}]}}},"required":["object","data"]},"TaskOpen":{"type":"object","description":"Say whose it is with reference or buyer_email for a credits account, or with subscription_id.","properties":{"budget":{"type":"integer","description":"The most the task may use.","minimum":1},"idempotency_key":{"type":"string","description":"Your own id for this task, up to 180 characters. A request sent twice with the same key opens one task and gets the first answer.","minLength":1,"maxLength":180},"subscription_id":{"type":"string","description":"The subscription the usage is on.","pattern":"^[0-9a-f]{32}$"},"reference":{"type":"string","description":"Your own id for the buyer, as carried on the checkout link: names a credits account.","maxLength":200},"buyer_email":{"type":"string","description":"The buyer's email address: names a credits account when the checkout link carried no reference."},"memo":{"type":"string","maxLength":200},"expires_in_minutes":{"type":"integer","description":"How long the task may run before it ends by itself; a day when left out.","minimum":1,"maximum":43200}},"required":["budget","idempotency_key"]},"UsageChargeCreate":{"type":"object","properties":{"quantity":{"type":"integer","description":"How many units to charge for.","minimum":1},"idempotency_key":{"type":"string","description":"Your own id for this charge, up to 200 characters. A request sent twice with the same key charges once and gets the first answer.","minLength":1,"maxLength":200},"memo":{"type":"string","maxLength":200},"meter":{"type":"string","description":"The key of the meter the units are for, when the product has meters."}},"required":["quantity","idempotency_key"]},"PlanChange":{"type":"object","properties":{"product_id":{"type":"string","description":"The plan to move to.","pattern":"^[0-9a-f]{32}$"}},"required":["product_id"]},"SeatsChange":{"type":"object","properties":{"seats":{"type":"integer","description":"A whole number up to the product's max_quantity.","minimum":1}},"required":["seats"]},"SubscriptionPause":{"type":"object","properties":{"months":{"type":"integer","description":"The renewals to skip.","minimum":1,"maximum":3}},"required":["months"]},"PortalSubscription":{"type":"object","description":"A subscription with what it costs and what its buyer may do alone.","properties":{"id":{"type":"string","description":"The id: 32 lowercase hex characters.","pattern":"^[0-9a-f]{32}$"},"object":{"const":"subscription"},"product_id":{"type":"string","description":"The plan it is on.","pattern":"^[0-9a-f]{32}$"},"reference":{"type":["string","null"]},"buyer_email":{"type":"string"},"buyer_name":{"type":"string"},"buyer_country":{"type":"string"},"quantity":{"type":"integer","description":"Seats: each period is charged this many times the price."},"answer":{"type":["string","null"]},"status":{"type":"string","description":"paused is between paused_from and paused_until.","enum":["active","past_due","canceled","paused"]},"renews_on":{"type":["string","null"],"description":"The day of the next charge. As YYYY-MM-DD.","format":"date"},"trial_ends_on":{"type":["string","null"],"description":"The day of the first charge after a free trial. As YYYY-MM-DD.","format":"date"},"paused_from":{"type":["string","null"],"description":"The first day of a pause. As YYYY-MM-DD.","format":"date"},"paused_until":{"type":["string","null"],"description":"The day it is next charged after a pause. As YYYY-MM-DD.","format":"date"},"cancel_requested_on":{"type":["string","null"],"description":"The day it was set to end. As YYYY-MM-DD.","format":"date"},"cancel_reason":{"type":["string","null"],"description":"Why the buyer cancelled, when they said.","enum":["too_expensive","not_using","missing","switched","done","other"]},"cancel_note":{"type":["string","null"],"description":"The buyer's own words on why they cancelled."},"created_at":{"type":"string","description":"When it was made, in UTC.","format":"date-time"},"product":{"type":"string","description":"The product's name."},"price_cents":{"type":"integer","description":"What one seat costs each period now."},"currency":{"type":"string","description":"The currency, as a three-letter code in lowercase.","enum":["usd","eur","gbp","cad","aud","nzd","sgd","hkd","chf","sek","nok","dkk","pln","czk","mxn"]},"billed":{"type":"string","enum":["month","year"]},"max_seats":{"type":"integer"},"lower_price":{"type":["object","null"],"description":"A lower price taken before a cancellation.","properties":{"renewals_left":{"type":"integer"},"then_cents":{"type":"integer","description":"What one seat costs after them."}},"required":["renewals_left","then_cents"]},"files":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"bytes":{"type":"integer"}},"required":["name","bytes"]}},"can":{"type":"object","description":"What the buyer may do alone today.","properties":{"cancel":{"type":"boolean"},"pause":{"type":"boolean"},"resume":{"type":"boolean"},"change_seats":{"type":"boolean"},"plans":{"type":"array","items":{"type":"object","properties":{"product_id":{"type":"string","description":"The id: 32 lowercase hex characters.","pattern":"^[0-9a-f]{32}$"},"name":{"type":"string"},"price_cents":{"type":"integer","description":"The price of one seat."},"billed":{"type":"string","enum":["month","year"]}},"required":["product_id","name","price_cents","billed"]}},"offers":{"type":["object","null"],"description":"What you chose to show before a cancellation.","properties":{"lower_price":{"type":["object","null"],"properties":{"percent":{"type":"integer"},"renewals":{"type":"integer"},"price_cents":{"type":"integer"},"then_cents":{"type":"integer"}},"required":["percent","renewals","price_cents","then_cents"]},"pause":{"type":"boolean"},"plans":{"type":"array","items":{"type":"object","properties":{"product_id":{"type":"string","description":"The id: 32 lowercase hex characters.","pattern":"^[0-9a-f]{32}$"},"name":{"type":"string"},"price_cents":{"type":"integer","description":"The price of one seat."},"billed":{"type":"string","enum":["month","year"]}},"required":["product_id","name","price_cents","billed"]}}},"required":["lower_price","pause","plans"]}},"required":["cancel","pause","resume","change_seats","plans","offers"]}},"required":["id","object","product_id","reference","buyer_email","buyer_name","buyer_country","quantity","answer","status","renews_on","trial_ends_on","paused_from","paused_until","cancel_requested_on","cancel_reason","cancel_note","created_at","product","price_cents","currency","billed","max_seats","lower_price","files","can"]},"SaleEvent":{"type":"object","description":"Something happened to a sale. Read status from the sale, not from the event's name.","properties":{"id":{"type":"string","description":"The same on every try and at every address: use it to ignore a repeat.","pattern":"^evt_[0-9a-f]{24}$"},"type":{"type":"string","enum":["sale.paid","sale.refunded","sale.disputed","sale.fraud_warning"]},"created":{"type":"string","description":"When it was made, in UTC.","format":"date-time"},"test":{"type":"boolean","description":"true on every event from a test business."},"data":{"type":"object","properties":{"sale":{"$ref":"#/components/schemas/Sale"}},"required":["sale"]}},"required":["id","type","created","test","data"]},"SubscriptionEvent":{"type":"object","description":"A subscription changed.","properties":{"id":{"type":"string","description":"The same on every try and at every address: use it to ignore a repeat.","pattern":"^evt_[0-9a-f]{24}$"},"type":{"type":"string","enum":["subscription.updated"]},"created":{"type":"string","description":"When it was made, in UTC.","format":"date-time"},"test":{"type":"boolean","description":"true on every event from a test business."},"data":{"type":"object","properties":{"subscription":{"$ref":"#/components/schemas/Subscription"}},"required":["subscription"]}},"required":["id","type","created","test","data"]},"PayoutEvent":{"type":"object","description":"A payout was sent.","properties":{"id":{"type":"string","description":"The same on every try and at every address: use it to ignore a repeat.","pattern":"^evt_[0-9a-f]{24}$"},"type":{"type":"string","enum":["payout.sent"]},"created":{"type":"string","description":"When it was made, in UTC.","format":"date-time"},"test":{"type":"boolean","description":"true on every event from a test business."},"data":{"type":"object","properties":{"payout":{"type":"object","properties":{"object":{"const":"payout"},"total_cents":{"type":"integer"},"currency":{"const":"usd"},"lines":{"type":"integer","description":"How many sales and reserves the payout was made of."},"sent_on":{"type":"string","description":"The day it was sent. As YYYY-MM-DD.","format":"date"}},"required":["object","total_cents","currency","lines","sent_on"]}},"required":["payout"]}},"required":["id","type","created","test","data"]},"CreditsLowEvent":{"type":"object","description":"A buyer's prepaid credits are running low.","properties":{"id":{"type":"string","description":"The same on every try and at every address: use it to ignore a repeat.","pattern":"^evt_[0-9a-f]{24}$"},"type":{"type":"string","enum":["credits.low"]},"created":{"type":"string","description":"When it was made, in UTC.","format":"date-time"},"test":{"type":"boolean","description":"true on every event from a test business."},"data":{"type":"object","properties":{"credit_balance":{"type":"object","properties":{"object":{"const":"credit_balance"},"account":{"type":"string"},"balance":{"type":"integer"},"alert_at":{"type":"integer"}},"required":["object","account","balance","alert_at"]}},"required":["credit_balance"]}},"required":["id","type","created","test","data"]},"UsageNotChargedEvent":{"type":"object","description":"Reported usage was closed without a charge.","properties":{"id":{"type":"string","description":"The same on every try and at every address: use it to ignore a repeat.","pattern":"^evt_[0-9a-f]{24}$"},"type":{"type":"string","enum":["usage.not_charged"]},"created":{"type":"string","description":"When it was made, in UTC.","format":"date-time"},"test":{"type":"boolean","description":"true on every event from a test business."},"data":{"type":"object","properties":{"usage":{"type":"object","properties":{"object":{"const":"usage_not_charged"},"subscription_id":{"type":"string","description":"The id: 32 lowercase hex characters.","pattern":"^[0-9a-f]{32}$"},"meter":{"type":["string","null"]},"quantity":{"type":"integer"},"reason":{"type":"string","description":"cap: past the product's monthly cap. payment_refused: the payment method was refused. subscription: it could no longer be charged for usage.","enum":["cap","payment_refused","subscription"]},"usage_charge_id":{"type":["string","null"],"description":"The id: 32 lowercase hex characters.","pattern":"^[0-9a-f]{32}$"}},"required":["object","subscription_id","meter","quantity","reason","usage_charge_id"]}},"required":["usage"]}},"required":["id","type","created","test","data"]},"TaskEvent":{"type":"object","description":"A task reached its budget.","properties":{"id":{"type":"string","description":"The same on every try and at every address: use it to ignore a repeat.","pattern":"^evt_[0-9a-f]{24}$"},"type":{"type":"string","enum":["task.budget_reached"]},"created":{"type":"string","description":"When it was made, in UTC.","format":"date-time"},"test":{"type":"boolean","description":"true on every event from a test business."},"data":{"type":"object","properties":{"task":{"$ref":"#/components/schemas/Task"}},"required":["task"]}},"required":["id","type","created","test","data"]},"PingEvent":{"type":"object","description":"A test event.","properties":{"id":{"type":"string","description":"The same on every try and at every address: use it to ignore a repeat.","pattern":"^evt_[0-9a-f]{24}$"},"type":{"type":"string","enum":["ping"]},"created":{"type":"string","description":"When it was made, in UTC.","format":"date-time"},"test":{"type":"boolean","description":"true on every event from a test business."},"data":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}},"required":["id","type","created","test","data"]},"Event":{"description":"An event, as a webhook address is sent it and as GET /events lists it.","oneOf":[{"$ref":"#/components/schemas/SaleEvent"},{"$ref":"#/components/schemas/SubscriptionEvent"},{"$ref":"#/components/schemas/PayoutEvent"},{"$ref":"#/components/schemas/CreditsLowEvent"},{"$ref":"#/components/schemas/UsageNotChargedEvent"},{"$ref":"#/components/schemas/TaskEvent"},{"$ref":"#/components/schemas/PingEvent"}]}}}}