Skip to main content
POST
Create a payment request

Authorizations

Authorization
string
header
required

Bearer token authentication. Include your API token in the Authorization header.

Format: Authorization: Bearer <your-token>

Headers

Idempotency-Key
string

Reusing a key with the same body returns the first request (200); with a different body, 409.

Required string length: 1 - 255

Body

application/json
description
string
required

The card's title line and the checkout's product name. Trimmed; 1 to 32 characters.

Required string length: 1 - 32
category
enum<string>
required

What is being paid for, the same three values as PayPal Orders v2 items[].category (PHYSICAL_GOODS, DIGITAL_GOODS, DONATION; developer.paypal.com/docs/api/orders/v2/). The App Store Review Guidelines (developer.apple.com/app-store/review/guidelines/) decide where each can be paid:

  • physical_goods: physical goods, and services used in the real world, such as a haircut or a ride (3.1.3(e)). Payable anywhere.
  • digital_goods: anything used in an app or online. A person pays by opening the link in Safari, and only on the United States storefront (3.1.1(a)); sending one to a person whose devices report only other storefronts returns 422 (error code 2006). A tip to an agent or a creator is digital_goods (3.1.1: tips to digital content providers use In-App Purchase).
  • donation: money for a charity or a fundraiser. Collected outside the app, on any storefront (3.2.2(iv): such apps "may only collect funds outside of the app, such as via Safari…").
Available options:
physical_goods,
digital_goods,
donation
amount
integer

Payment mode (required there). What to charge, in the currency's minor units; Stripe's minimum and maximum apply. Omit in subscription mode.

currency
string

Payment mode (required there). A 3-letter ISO 4217 code, returned lowercase. Omit in subscription mode; the price carries it.

Pattern: ^[A-Za-z]{3}$
metadata
object

Up to 49 keys of your own, returned on the request and on every payment.* event, and stamped on the Stripe objects created on your account. Keys starting with relay_ are reserved; Relay adds relay_payment_request_id.

mode
enum<string>
default:payment

payment collects one charge of amount in currency. subscription starts an auto-renewing subscription from a recurring price_id on your connected Stripe account; the person pays the first period at checkout and Stripe renews it from then on.

Available options:
payment,
subscription
price_id
string

Subscription mode (required there). An active recurring Price on your connected Stripe account.

quantity
integer

Subscription mode only. Units of the price. Defaults to 1.

Required range: x >= 1
customer_id
string

An existing Customer on your connected Stripe account (cus_...) to attach the request to.

discount
object

Subscription mode only. One coupon or one promotion code from your connected Stripe account, never both.

image_url
string

Optional product picture, an HTTPS address, like Telegram sendInvoice photo_url (core.telegram.org/bots/api#sendinvoice). Relay copies it into its own image store, the way it stores agent pictures, and returns Relay's address. Shown on the card and on the pay page.

Maximum string length: 2048

Response

The same Idempotency-Key and body were used before; the first request is returned.

id
string<uuid>
required
object
enum<string>
required
Available options:
payment_request
status
enum<string>
required

A payment request's lifecycle. It leaves requested exactly once, and only on Stripe's word or your cancel.

Available options:
requested,
succeeded,
canceled,
expired
mode
enum<string>
required
Available options:
payment,
subscription
amount
integer
required

What the person is charged at checkout, in minor units. In subscription mode, what the first period costs after any discount.

currency
string
required
description
string
required
category
enum<string>
required

What is being paid for, the same three values as PayPal Orders v2 items[].category (PHYSICAL_GOODS, DIGITAL_GOODS, DONATION; developer.paypal.com/docs/api/orders/v2/). The App Store Review Guidelines (developer.apple.com/app-store/review/guidelines/) decide where each can be paid:

  • physical_goods: physical goods, and services used in the real world, such as a haircut or a ride (3.1.3(e)). Payable anywhere.
  • digital_goods: anything used in an app or online. A person pays by opening the link in Safari, and only on the United States storefront (3.1.1(a)); sending one to a person whose devices report only other storefronts returns 422 (error code 2006). A tip to an agent or a creator is digital_goods (3.1.1: tips to digital content providers use In-App Purchase).
  • donation: money for a charity or a fundraiser. Collected outside the app, on any storefront (3.2.2(iv): such apps "may only collect funds outside of the app, such as via Safari…").
Available options:
physical_goods,
digital_goods,
donation
checkout_url
string
required

Relay's pay page for this request, https://pay.relayapp.im/<token>. Anyone holding it can pay the request. Send it back unchanged in a payment part.

expires_at
string<date-time>
required

When the request stops accepting payment and moves to expired, 23 hours after it was created.

metadata
object
required
stripe
object
required

The ids of the Stripe objects on your connected account, your join keys into your own Stripe Dashboard, API and webhooks.

created_at
string<date-time>
required
updated_at
string<date-time>
required
image_url
string

The product picture, on Relay's image host. Absent without one.

price_id
string

Subscription mode.

quantity
integer

Subscription mode.

interval
enum<string>

Subscription mode.

Available options:
day,
week,
month,
year
interval_count
integer

Subscription mode.

discount
object

Subscription mode only. One coupon or one promotion code from your connected Stripe account, never both.

paid_at
string<date-time>

Absent until the request succeeds.