Skip to content

How should my video API integration show a declined request when a credit purchase is still pending?

Use the authoritative balance and generation response to determine whether the task was accepted. AISwapLab documents HTTP 402 for insufficient credits. A receipt or a pending checkout alone does not show that usable credits have posted.

SHIP A RELIABLE INTEGRATIONAISwapLab team · Editorial methodPublished 2 min read
Open API documentationExplore 67 Image SkillsPrivate keys · Explicit credit approval

Keep the displayed states separate

Show the unresolved purchase, the observed credit balance and the declined job state. Verify the quote still matches the intended request.

Require an explicit next paid action

Confirm usable balance using the documented account information. If the earlier create result was uncertain, recover its status before a repeat. If it was a confirmed rejection, wait for a fresh decision from the user.

Example

The purchase redirect returns before the account balance reflects the pack. The application can offer a refresh without sending a second video request.

Pass condition

The customer sees whether credits posted and whether the original generation was accepted before any further paid action.

Sources

One task. A recoverable workflow.

Check the contract, approve the quote and retain the job.

Open API documentation