Update a payment
Use this endpoint to update a payment and/or to trigger tasks related to a payment.
API consumers request updates by sending actions to this endpoint. An action specifies what you want to do to the resource. The Bango Platform decides whether the action is permitted, and if so it performs the action. An action might result in a change to the resource’s properties, and might cause a side effect. Actions are logged as *_REQUESTED events. The Bango Platform also logs events recording whether the action succeeded or failed.
An action might be syntactically valid but not permitted at the time the partner sends it, depending on various factors. These factors include:
- Whether the Bango Platform is already processing an action
- Whether the partner is permitted to perform the action when the payment resource is in its current state (for example, a specific policy applies to the partner that doesn’t apply to all partners)
- Whether the action makes sense in the current state (for example, a request to capture more than authorized will be rejected)
These types of actions DO NOT cause a 400 error. Instead, the resource returned in the response contains a result property. This indicates how the Bango Platform treated the request.
To send an action, partners can:
- Use the
ridof the payment: this is a unique identifier (UUID v4) created by the Bango Platform - Use an alias for the
rid, for examplepartnerPaymentId:ahskdfiu234. (The Bango Platform creates this alias automatically if the partner specifies apartnerPaymentIdwhen creating the payment)
400 response error codes:
invalid-jsonif the request body isn’t valid JSON formatmissing-parameteriftypeis not present in the request bodyinvalid-parameteriftypeis not a valid action typemissing-parameterifpayloadis required and not presentinvalid-parameterifpayloadis not the expected shape for the type of action (which may mean thatpayloadis missing required parameters or some parameters are invalid: check the documentation to find out the expected payload shape for each action type)
Authorizations
Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.
Headers
A unique identifier to use for idempotency purposes.
"76aa2331-a96a-4a3b-8c23-019aabb44ed1"
Path Parameters
Globally unique namespace ID. These IDs are opaque, not guessable, and not sequential.
Bango provides each Bango partner with a unique set of resource URIs. All resource URI paths start with /ns/{nsid}, where {nsid} is the namespace ID. No other Bango partner shares this namespace. Partner credentials permit access only to URIs with this namespace.
"673c74de-ce5b-4f79-9851-2544d1d836cb"
Globally unique resource ID. These IDs are opaque, not guessable, and not sequential.
Each individual resource in a partner's namespace has a unique identifier: this is the identifier immediately after the resource type in the URI path.
For example, in the URI /ns/673c74de-ce5b-4f79-9851-2544d1d836cb/elephants/581b2e40-741c-4683-ae66-46c9fe6f4d5e:
- The namespace id is
673c74de-ce5b-4f79-9851-2544d1d836cbde elephantsindicates the resource type iselephant- The resource id is
581b2e40-741c-4683-ae66-46c9fe6f4d5e
Every resource has a read-only property rid that contains the resource ID, for convenience.
"581b2e40-741c-4683-ae66-46c9fe6f4d5e"
Body
A request to update a payment and trigger session-related tasks. A request specifies an action type and any action-specific data (the payload).
The following action types are available. See each action type schema for detailed information.
AUTHORIZE: A request to reserve funds from a payment provider's end user (two-step payment, step 1)CAPTURE: A request to capture funds from a payment provider's end user (two-step payment, step 2)REFUND: A request to refund an amount to a payment provider's end userCANCEL_AUTH: A request to release funds reserved from a payment provider's end userCHARGE: A request to capture funds from a payment provider's end user (one-step payment)
Whether an action has any effect depends on the current state value of the session, and other factors. The response to this request is the session resource: the state property might have changed as a result of the request.
- AUTHORIZE API action
- CANCEL_AUTH API action
- CAPTURE API action
- CHARGE API action [plan-later]
- REFUND API action
A request to reserve funds from a payment provider's end user (two-step payment, step 1). The request may be denied (for example, if the amount to reserve is too great).
To authorize an amount less than or equal to the payment resource's saleItem.price property, set payload.amount and payload.currency to the amount to authorize.
To authorize the saleItem.price, omit both payload.amount and payload.currency or set them explicitly to the values in saleItem.price.
The optional locale is passed to the payment provider.
Authorize the full amount specified in the payment resource's saleItem.price property, and optionally specify the merchant end user's locale and a request ID
- Authorize full amount, optional locale
- Authorize specific amount, optional locale
Response
The updated resource.
A payment resource.
Globally unique resource ID. These IDs are opaque, not guessable, and not sequential.
Each individual resource in a partner's namespace has a unique identifier: this is the identifier immediately after the resource type in the URI path.
For example, in the URI /ns/673c74de-ce5b-4f79-9851-2544d1d836cb/elephants/581b2e40-741c-4683-ae66-46c9fe6f4d5e:
- The namespace id is
673c74de-ce5b-4f79-9851-2544d1d836cbde elephantsindicates the resource type iselephant- The resource id is
581b2e40-741c-4683-ae66-46c9fe6f4d5e
Every resource has a read-only property rid that contains the resource ID, for convenience.
"581b2e40-741c-4683-ae66-46c9fe6f4d5e"
A unique identifier for a payment method used to charge a payment provider's end user.
To obtain a payment instrument token, use the Bango Identity Verification API.
To charge an end user using a payment instrument token, use the Bango Payments API.
"65ea5204-f1c1-463d-9eab-da7977960e2d"
An item (product or service) purchased in whole or part by a payment.
RFC 3339 datetime of the last update to this resource
"2022-12-21T08:59:32Z"
The total amounts currently authorized, captured, refunded, and canceled for the payment, taking all successful actions into account. Values exclude any requests awaiting a response from the downstream payment provider.
For one-step payments (the CHARGE action), the authorized and captured values are always identical.
The high-level view of the progress of the payment through the standard lifecycle. Allowed values are:
creating- the partner requested a new payment resource but the request has not yet been approvednew- the payments system approved a request to create a payment resource and there are no approved authorization/capture/charge/refund events. Balances:authorized == 0, captured == 0, refunded == 0authorized- the payments system approved a request to create a payment resource and there's at least one approved authorization event, but no captures, charges, or refunds. Balances:authorized > 0, captured == 0, refunded == 0captured- the payments system approved a request to create a payment resource and there's at least one approved authorization/capture/charge event, and maybe some refunds, and the payment isn't fully refunded. Balances:authorized > 0, captured > 0, refunded >= 0, captured > refundedrefunded- the payments system approved a request to create a payment resource and the payment is fully refunded. Balances:authorized > 0, captured > 0, refunded > 0, captured == refundedclosed- the payment resource is effectively frozen. No actions will be processed.
creating, new, authorized, captured, refunded, closed Indicates whether the Bango Platform is:
preparing: preparing to process a partner action, and NOT ready to receive a new actionprocessing: processing a partner action (including waiting for a response from the downstream payment provider), and NOT ready to receive a new actionidle: NOT currently processing a partner action, and ready to receive a new action
While processingState is preparing or processing, the Bango Platform will reject any new action for this payment resource.
idle, preparing, processing The result of the most recent action, if any.
An internal action that occurs automatically when the merchant partner creates the payment. A merchant can't send this action explicitly.
- CREATE pseudo-API action
- AUTHORIZE API action
- CANCEL_AUTH API action
- CAPTURE API action
- CHARGE API action [plan-later]
- REFUND API action
The merchant partner's own unique identifier for the payment. Not necessarily a UUID. The Bango Platform considers this an opaque value but checks for uniqueness when the payment is being created (400 error if not).
1 - 255"asdfg-asdfhj-fgrewa-bcczx"
Merchant-owned request identifier. Bango considers this identifier opaque, and passes it to the payment provider unchanged (in OPPA request actions, as merchantPaymentId).
In a returned payment resource, the partnerRequestId reflects the value specified in the request from the merchant. If a request does not specify a partnerRequestId then the response does not include a partnerRequestId.
1 - 255"zfknveriuouzxcqweff12tgdvxxzb0"
The payment provider's own unique identifier for the payment. Not necessarily a UUID. Bango assumes it is unique.
The payment provider may supply this value in response to a request from the Bango Platform. Subsequent requests to the payment provider include the value where relevant, and responses to the Bango Platform may replace the value.
The current value is given to the merchant in the payment resource.
1 - 255"345hkjhsgdkfgh43k5hjkhk1"
Data shared between the merchant partner and the payment provider as part of a payment resource. Supplied to the payment provider with every payment action, such as AUTHORIZE or CHARGE.

