Payments
Cancel a payment request
Cancel a request that has not been paid: its PaymentIntent is
canceled (in subscription mode, the first-period invoice is voided and
the incomplete Subscription canceled), the request moves to
canceled, every card that carries it changes in place, and your
agent gets payment.canceled. A request that is already succeeded,
canceled or expired, or that was paid before the cancel reached
Stripe, returns 409.
POST
/
v1
/
payment_requests
/
{paymentRequestId}
/
cancel
Cancel a payment request
curl --request POST \
--url https://api.relayapp.im/v1/payment_requests/{paymentRequestId}/cancel \
--header 'Authorization: Bearer <token>'{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"object": "payment_request",
"status": "requested",
"mode": "payment",
"amount": 123,
"application_fee_amount": 123,
"currency": "<string>",
"description": "<string>",
"category": "physical_goods",
"checkout_url": "<string>",
"expires_at": "2023-11-07T05:31:56Z",
"metadata": {},
"stripe": {
"payment_intent_id": "<string>",
"customer_id": "<string>",
"subscription_id": "<string>"
},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"image_url": "<string>",
"price_id": "<string>",
"quantity": 123,
"interval": "day",
"interval_count": 123,
"discount": {
"coupon": "<string>",
"promotion_code": "<string>",
"label": "<string>"
},
"paid_at": "2023-11-07T05:31:56Z"
}{
"error": {
"status": 123,
"code": 123,
"message": "<string>",
"doc_url": "<string>",
"retry_after": 123
},
"success": true,
"trace_id": "<string>"
}{
"error": {
"status": 123,
"code": 123,
"message": "<string>",
"doc_url": "<string>",
"retry_after": 123
},
"success": true,
"trace_id": "<string>"
}{
"error": {
"status": 123,
"code": 123,
"message": "<string>",
"doc_url": "<string>",
"retry_after": 123
},
"success": true,
"trace_id": "<string>"
}{
"error": {
"status": 123,
"code": 123,
"message": "<string>",
"doc_url": "<string>",
"retry_after": 123
},
"success": true,
"trace_id": "<string>"
}{
"error": {
"status": 123,
"code": 123,
"message": "<string>",
"doc_url": "<string>",
"retry_after": 123
},
"success": true,
"trace_id": "<string>"
}{
"error": {
"status": 123,
"code": 123,
"message": "<string>",
"doc_url": "<string>",
"retry_after": 123
},
"success": true,
"trace_id": "<string>"
}Authorizations
Response
The canceled payment request
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 code2006). A tip to an agent or a creator isdigital_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 āI
Cancel a payment request
curl --request POST \
--url https://api.relayapp.im/v1/payment_requests/{paymentRequestId}/cancel \
--header 'Authorization: Bearer <token>'{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"object": "payment_request",
"status": "requested",
"mode": "payment",
"amount": 123,
"application_fee_amount": 123,
"currency": "<string>",
"description": "<string>",
"category": "physical_goods",
"checkout_url": "<string>",
"expires_at": "2023-11-07T05:31:56Z",
"metadata": {},
"stripe": {
"payment_intent_id": "<string>",
"customer_id": "<string>",
"subscription_id": "<string>"
},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"image_url": "<string>",
"price_id": "<string>",
"quantity": 123,
"interval": "day",
"interval_count": 123,
"discount": {
"coupon": "<string>",
"promotion_code": "<string>",
"label": "<string>"
},
"paid_at": "2023-11-07T05:31:56Z"
}{
"error": {
"status": 123,
"code": 123,
"message": "<string>",
"doc_url": "<string>",
"retry_after": 123
},
"success": true,
"trace_id": "<string>"
}{
"error": {
"status": 123,
"code": 123,
"message": "<string>",
"doc_url": "<string>",
"retry_after": 123
},
"success": true,
"trace_id": "<string>"
}{
"error": {
"status": 123,
"code": 123,
"message": "<string>",
"doc_url": "<string>",
"retry_after": 123
},
"success": true,
"trace_id": "<string>"
}{
"error": {
"status": 123,
"code": 123,
"message": "<string>",
"doc_url": "<string>",
"retry_after": 123
},
"success": true,
"trace_id": "<string>"
}{
"error": {
"status": 123,
"code": 123,
"message": "<string>",
"doc_url": "<string>",
"retry_after": 123
},
"success": true,
"trace_id": "<string>"
}{
"error": {
"status": 123,
"code": 123,
"message": "<string>",
"doc_url": "<string>",
"retry_after": 123
},
"success": true,
"trace_id": "<string>"
}
