public-api-key and private-secret-key headers. Find them in your Yuno Dashboard.
Do not share your secret API keys in public places like GitHub or Bitbucket to avoid malicious API calls.
X-Idempotency-Key may be required. This UUID must be unique for each request. See Idempotency for details.
Example request:
Idempotency
Idempotency lets you safely retry a request when its outcome is unclear, such as a timeout, a connection error, or a500 response. It removes the risk of performing the operation twice.
Some requests include a unique identifier sent as the X-Idempotency-Key header (for example, 7bf41af5-70ae-4e79-9b28-a8fa75c3ac53). This key also serves to identify a specific transaction.
Set the
x-idempotency-key value to {$randomUUID} to generate keys automatically.X-Idempotency-Key produces one of the following results:
- The original response. If the first request with this key created a payment (whatever its status: approved, authorized, or declined), any later request with the same key returns that original payment instead of creating a new one. The body of the retry is ignored.
400 REQUEST_IN_PROCESS. The first request with this key is still being processed. Retry with the same key after a few seconds.400 IDEMPOTENCY_DUPLICATED. The first request with this key failed before a payment was created. No payment exists for this key, and the key cannot be reused: correct the request and send it with a new key.- Normal processing. If the first request was rejected before processing started (for example, a malformed body), the key was not consumed and the retry is processed as a new request.
Recommended retry logic
- If a request fails with an unclear outcome (a timeout, a connection error, a
500, or a response you cannot parse), retry it with the same key. The retry either returns the original result, processes normally, or returnsIDEMPOTENCY_DUPLICATED, which means no payment was created. - Use a new key only to start a genuinely new attempt: a new order, or a new attempt after a decline or after
IDEMPOTENCY_DUPLICATED. - Never retry an unclear failure with a new key. If the original request actually succeeded, retrying it with a new key creates a duplicate operation.