Skip to main content
POST
Use this when a customer pays you through your own billing system, like an invoice or a bank transfer, and the money belongs in their Juiced balance. It works just like adding or removing funds on the customer in Juiced. Their bids see the new balance right away, and the customer’s activity timeline shows your API key’s label.
No card is charged. A credit adds to the customer’s balance and a debit takes from it, and that’s all that happens. Collect the payment yourself before you send the credit.
  • A credit adds amount to the customer’s balance. Add a receipt_url to link the customer to your own receipt. It’s only accepted on credits.
  • A debit takes amount from the customer’s balance. It can’t be more than the customer’s balance from Get a Customer, which subtracts funds held for pending pings. A larger debit is refused with validation_failed on amount, the message names that balance, and nothing moves.
amount is in dollars, with at most 2 decimal places, from 0.01 up to 99,999,999.99. It’s always positive, since type sets the direction. description is required and shows on the customer’s transactions in their portal, so write it for them. The response’s balance is the customer’s wallet balance right after this credit or debit, before funds held for pending pings. It’s the same figure the transaction shows in List Transactions, and a replayed response carries it too. Archived customers can be credited and debited too. Credits and debits for one customer run one at a time, so each request sees the balance the one before it left. This endpoint needs the funds:write ability.

The Idempotency-Key header is required

Because this endpoint moves money, every request must send an Idempotency-Key header. A request without one returns 422 with validation_failed, the error names the Idempotency-Key header, and no money moves. Use an ID from your own system, such as your payment or invoice ID, so a retry of the same payment always sends the same key. A key belongs to the customer URL it was first sent to.
  • Same key, same body, same customer within 24 hours returns the first response again, with an Idempotent-Replayed: true header. The funds only move once.
  • Same key, different body returns 409 with idempotency_conflict.
  • Same key and body for a different customer also returns 409 with idempotency_conflict, and nothing moves. It’s never replayed as the first customer’s response.
  • The first request is still running returns 409 with idempotency_in_progress and a Retry-After header.
  • A server error (5xx) moves no money and isn’t saved against the key, so send the same request again.
See Safe retries for the details.

Authorizations

Authorization
string
header
required

An API key from Configure → API Keys (it starts with jz_live_), sent as a bearer token. See API Keys.

Headers

Idempotency-Key
string
required

Required. An ID from your own system, such as your payment ID. A retry with the same key and body to the same customer within 24 hours returns the first response, and the funds move once. The same key sent for a different customer, or with a different body, is a 409 conflict.

Maximum string length: 255

Path Parameters

id
string
required

The customer's ID.

Pattern: ^cus_[0-9a-z]{26}$

Body

application/json
type
enum<string>
required

credit adds to the customer's balance and debit takes from it.

Available options:
credit,
debit
amount
number
required

In dollars, with at most 2 decimal places. Always positive, since type sets the direction. A debit can't be more than the customer's balance.

Required range: 0.01 <= x <= 99999999.99
description
string
required

What the funds are for, like Invoice 1042 paid. The customer sees it on their transactions.

Maximum string length: 255
receipt_url
string<uri> | null

Credits only. A link to the receipt in your own billing system. Sending one with a debit is refused.

Maximum string length: 2048

Response

Funds moved. A retry with the same Idempotency-Key and body to the same customer returns this same response again, with an Idempotent-Replayed: true header.

data
Transaction · object
version
enum<string>
Available options:
v1