Skip to navigation

Upload a receipt

Attaches one receipt file to a transaction made by a user. Send the file as the request body, with its media type as Content-Type: application/pdf, image/jpeg, image/png or image/webp, at most 25 MB. The transaction’s other receipt files stay attached.

The file is read and attached in the background. It appears in GET /transactions/{transactionId}/receipts once attached. If it cannot be processed, it is not attached; upload it again with a new Idempotency-Key.

A transaction with no user, such as a fee or a transfer, is refused with NOT_ELIGIBLE. A file whose content does not match its Content-Type is refused with INVALID_REQUEST. Reuse the Idempotency-Key for retries; a retry with the same file attaches it once.

Authentication

AuthorizationBearer

Access token from POST /access-token. Valid for at most 30 minutes.

Path parameters

transactionIdstringRequiredformat: "^[A-Za-z0-9_-]+$"1-128 characters
The transaction's ID.

Headers

Account-HolderstringOptionalformat: "^[A-Za-z0-9_-]+$"1-128 characters

The account holder a platform API key acts on. Platform keys must send it on account holder operations. A company API key acts on its own account holder; it may omit the header or send its own account holder ID.

Idempotency-KeystringRequiredformat: "^(?:[!#-~][!-~]{0,254}|"[!#-\[\]-~]{1,255}")$"1-257 characters

Your unique key for this operation: 1 to 255 visible ASCII characters, ideally a new UUID v4 for each operation. A value in double quotes is accepted and the quotes are removed. Retrying with the same key and the same request returns the first response with Idempotent-Replayed: true; the same key with a different request is refused with IDEMPOTENCY_KEY_REUSED. A key can be used again 30 days after its operation completes.

X-Request-IdstringOptionalformat: "^[A-Za-z0-9._:-]+$"1-128 characters

Your own correlation ID for this request. It is recorded with the request. The X-Request-Id response header is always generated by the server.

Request

The receipt file, at most 25 MB.

Response headers

X-Request-Idstringformat: "uuid"
Unique ID of this request. Quote it when you contact support.
RateLimitstringOptional

Remaining budget for each rate limit policy, for example "burst"; r=57; t=6 (requests remaining and seconds until the window resets).

RateLimit-PolicystringOptional

The rate limit policies applied to this request, for example "burst"; q=60; w=10 (requests allowed per window of seconds).

Locationstring

Path of the resource, relative to the API host, for example /api/v2/embeddedSessions/0b6f3c1e-5d2a-4c8e-9a71-3f4d2e1b6c90.

Idempotent-ReplayedenumOptional

Sent as true when this response repeats the first response to the same Idempotency-Key. A replay keeps the first response’s status and body, including the requestId of a problem; X-Request-Id is new.

Allowed values:

Response

The file was accepted and is being attached. The body is the transaction, and Location is its receipt list.

idstringformat: "^[A-Za-z0-9_-]+$"1-128 characters

A resource ID. Treat it as an opaque, case-sensitive string.

objectenum

Always transaction.

Allowed values:
livemodeboolean

true on a live platform in production, false on a Sandbox platform and outside production.

createdAtdatetime
When the transaction was recorded.
updatedAtdatetime
When the transaction last changed.
transactedAtdatetime
When the activity happened. Lists are ordered by it, newest first.
typeenum

CARD_AUTHORIZATION holds funds for a card purchase that has not been captured. CARD_SPEND is a captured card purchase. CARD_REFUND is money a merchant returned to the card. DISPUTE_CREDIT is money credited back to the card for a dispute. DISPUTE_CREDIT_REVERSAL takes a dispute credit back. CASH_REIMBURSEMENT and MILEAGE_REIMBURSEMENT pay a user back for an expense or a trip. INBOUND_TRANSFER and OUTBOUND_TRANSFER move money between a financial account and a bank; each is also the /transfers resource named by transferId. INBOUND_WIRE and OUTBOUND_WIRE are wires. INBOUND_PAYMENT is a payment received for an invoice, a payment link or a subscription, net of its fee; OUTBOUND_PAYMENT is a payment sent. INBOUND_FUNDS is money received without an invoice, such as a donation. PAYMENT_REFUND returns an inbound payment to its payer. FEE is the processor’s fee on an inbound payment: positive when taken, negative when returned with a refund. INBOUND_REWARDS and OUTBOUND_REWARDS move rewards into and out of a financial account. REWARDS_ACCRUAL records rewards earned, BALANCE_TRANSFER moves rewards between balances and REWARDS_TO_BALANCE redeems rewards into a financial account’s balance, negative as it leaves the rewards balance. CHARGE_REPAYMENT pays down a charge card program’s balance.

statusenum

PENDING has not posted yet, including a payout still owed after an attempt failed. POSTED is final. DECLINED was refused, failed or was canceled, and moved no money. REVERSED was released without being captured, or was returned after it moved. statusDetail says more.

Allowed values:
statusDetailenum

The status in full. COMPLETE posted. REFUNDED is a card refund that posted. PERSONAL_PENDING, PERSONAL_PROCESSING, PERSONAL_COMPLETE and PERSONAL_FAILED follow a user’s repayment of a purchase marked personal; PERSONAL_REFUNDED is one the merchant refunded. PENDING_BANK_ACCOUNT waits for the payee’s bank account, PENDING_PAYMENT for its payout, PROCESSING_PAYMENT and PROCESSING are in flight, INSUFFICIENT_FUNDS waits for funds and PAYMENT_FAIL failed and will be paid again. CLOSED is an authorization closed without a capture. FAILED, CANCELED and RETURNED ended a movement of money. REFUND_PENDING, REFUND_FAIL and REFUND_CANCELED follow a payment refund; REFUND_SUCCESS and PARTIALLY_REFUNDED are inbound payments refunded in full and in part.

personalboolean

true when a user marked the purchase as a personal expense to repay.

amountobject

Negative when money leaves the account holder, such as spend or a reimbursement, positive when it arrives, such as a refund or an inbound payment. FEE and REWARDS_TO_BALANCE are signed as their types describe.

disputeIdstringOptionalformat: "uuid"

The dispute this transaction belongs to, as GET /disputes/{disputeId} accepts it. Set on a disputed purchase and on its dispute credit and reversal transactions.

parentTransactionIdstringOptionalformat: "uuid"

The transaction this one belongs to: the purchase of a card refund or a dispute credit, the inbound payment of a payment refund or a fee, or the purchase a repayment pays for.

providerReferencestringOptional
The issuer's ID for the transaction.
transferIdstringOptionalformat: "uuid"

The transfer this transaction is, as GET /transfers/{transferId} returns it.

cardIdstringOptionalformat: "^[A-Za-z0-9_-]+$"1-128 characters
The card the transaction was made with.
cardTypeenumOptional

VIRTUAL and PHYSICAL are cards issued to the account holder. EXTERNAL is a card from another issuer that the account holder linked.

Allowed values:
userIdstringOptionalformat: "^[A-Za-z0-9_-]+$"1-128 characters
The user who holds the card, or who is reimbursed or paid.
userobjectOptional

The user a transaction belongs to, added with extend=user.

authorizationIdstringOptional
The card issuer's reference for the authorization behind this transaction. An opaque reference that is not a transaction ID.
merchantobjectOptional

The merchant: as the card network reported it for card activity, as entered for a reimbursement, and the other party’s name for a payment or a transfer.

memostringOptional
The note a user wrote on the transaction.
settledAtdatetimeOptional
When the transaction settled.

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
404
Not Found Error
409
Conflict Error
413
Content Too Large Error
415
Unsupported Media Type Error
422
Unprocessable Entity Error
429
Too Many Requests Error
500
Internal Server Error
502
Bad Gateway Error
503
Service Unavailable Error