Skip to Content
API ReferenceTickets

Refund a ticket to the customer's wallet

Credit the customer's store wallet for an item of the ticket's order and send them a note.

This moves money and messages the customer. The credit lands in the customer's store wallet as USD they can spend in your store; it is not a refund to their card. Your customer_note is posted as your reply on the ticket, and the customer gets it by email. The ticket stays open.

Your API key needs both the ticket and support.refund abilities, and the store member who owns the key needs both the ticket and the support refund permissions.

Refund in two steps

Set your API credentials and store using the quickstart. Replace 312 with the ticket ID.

First, list the wallet refund options and pick the item. Note its invoice_id and refundable_cents.

export TICKET_ID=312
curl --fail-with-body "${SELLAPP_API_BASE_URL}/v2/tickets/${TICKET_ID}/wallet-refund-options" \
  --header "Authorization: Bearer ${SELLAPP_API_KEY}" \
  --header "X-STORE: ${SELLAPP_STORE}"

Then send the refund with a new idempotency key. Here the item has invoice_id 5120 and 1999 cents left to refund, and you credit 500 cents ($5.00).

export REFUND_KEY="ticket-312-refund-001"
curl --fail-with-body --request POST "${SELLAPP_API_BASE_URL}/v2/tickets/${TICKET_ID}/wallet-refunds" \
  --header "Authorization: Bearer ${SELLAPP_API_KEY}" \
  --header "X-STORE: ${SELLAPP_STORE}" \
  --header "Content-Type: application/json" \
  --header "Idempotency-Key: ${REFUND_KEY}" \
  --data '{"invoice_id":5120,"amount_cents":500,"expected_refundable_cents":1999,"customer_note":"We added $5.00 to your store wallet for the trouble with your download link."}'

A 201 response returns the refund with its id and the wallet's balance_after_cents.

Retries and refusals

If the response is lost, send the same request with the same Idempotency-Key within 24 hours. You get the original refund back with Idempotent-Replayed: true, and the customer is not credited or emailed again. Do not create a new key for a retry. A new key with the same body is refused with 422 on expected_refundable_cents, because the first refund already lowered what is left; a new key with the same amount and note as your earlier refund is refused on customer_note. If you do mean to credit the customer again, read the options again and write a different note.

A 422 credits nothing. expected_refundable_cents means someone refunded this item since you read the options: read them again before deciding. amount_cents means the amount is more than is left. ticket means the customer's wallet refused the credit, for example because it is frozen.

To take a refund back, use Reverse a ticket wallet refund.

POST
/v2/tickets/{ticket}/wallet-refunds

Credit the customer's store wallet for one item of the ticket's order and send customer_note to the customer. This moves money: the credit is store credit in USD that the customer can spend in your store, and the note is posted as your reply on the ticket, which emails it to the customer. The ticket stays open. Read the ticket's wallet refund options first, then send the item's invoice_id, the amount_cents to credit (at most its refundable_cents) and expected_refundable_cents equal to the refundable_cents you read. If what is left to refund changed since you read it, the request returns 422 on expected_refundable_cents and credits nothing: read the options again. Amounts are integer USD cents: 500 means $5.00. Requires both the ticket and support.refund API-key abilities, and the store member needs both the ticket and the support refund permissions. Send an Idempotency-Key header; requests without one return 400. Retrying with the same key and identical body within 24 hours returns the original refund with Idempotent-Replayed: true and does not credit or email the customer again. Never retry under a new key: the first refund already lowered what is left, so the retry returns 422 on expected_refundable_cents, and a request with the same amount and note as an earlier refund of this item returns 422 on customer_note. Change the note if you mean to credit the customer a second time. OAuth callers use the admin grant and select a store with X-STORE. Current membership and role permissions apply to every request.

Authorization

headerAuthorizationBearer <API Key>

Provide your SellApp API key as a bearer token.

Path Parameters

ticket*integer

The ticket ID in the selected store.

Header Parameters

Idempotency-Key*string

Reuse this key only for an identical retry. A replay returns Idempotent-Replayed: true.

Length8 <= length <= 255
X-STORE?string

Store slug. Required for OAuth access tokens. API keys may omit it to use their current store, or the first accessible store when no current store is selected.

Request Body

application/json
  1. body
invoice_id*integer

The item to refund, from the ticket's wallet refund options. It must be an item of the ticket's order that was not refunded.

Range1 <= value
amount_cents*integer

Credit to add, in USD cents: 500 means $5.00. At most the item's refundable_cents.

Range1 <= value
expected_refundable_cents*integer

The item's refundable_cents as you read it. It protects against refunding the same money twice when someone else refunded in between.

Range0 <= value
customer_note*string

Message to the customer, at least 6 characters after trimming. It is posted on the ticket and emailed. A leftover placeholder such as {refund_amount} is refused.

Length6 <= length <= 2000

Response Body

The refund was issued, or the original refund is replayed for the same Idempotency-Key and body.

application/json
  1. response
data*
Example Request
curl -X POST 'https://sell.app/api/v2/tickets/312/wallet-refunds' \  -H 'Idempotency-Key: ticket-312-refund-001' \  -H 'X-STORE: launch-lab' \  -H 'Content-Type: application/json' \  -d '{  "invoice_id": 5120,  "amount_cents": 500,  "expected_refundable_cents": 1999,  "customer_note": "We added $5.00 to your store wallet for the trouble with your download link."}'
{  "data": {    "id": 7001,    "ticket_id": 312,    "invoice_id": 5120,    "customer_id": 42,    "amount_cents": 500,    "currency": "USD",    "balance_after_cents": 500,    "customer_note": "We added $5.00 to your store wallet for the trouble with your download link.",    "automatic": false,    "reversed": false,    "reversal": null,    "created_at": "2026-09-04T09:30:00.000000Z"  }}