Creating a Payment Batch

4 minute read

This guide gives you a walkthrough on how to create many asynchronous payments aka Payment Batch simultaneously. After this you will have a clear understanding of what a Payment Batch is and when it's suitable to use and how to use it.

This guide assumes you have read Key Concepts and followed the guide Creating a Payment.

Use cases

Batch payments allow you to submit multiple payments in a single API request, with each payment processed asynchronously as soon as possible. This is ideal for recurring billing scenarios where you need to charge many customers at once.

This way you can initiate and process a large number of payments much faster instead of creating 1000s individual Payment and PaymentOrders.

Payment Methods

Only payment methods that are asynchronous and don't require interactive user flows are batchable:

ProviderMethodCurrency
swishrecurringSEK
bankgirotautogiroSEK
pingdepositSEK, NOK, EUR

How it works

  1. Submit batch - POST to /api/v1/payment_batches with all entries
  2. Receive batch ID - Response returns immediately after validation
  3. Async processing - Each entry is processed independently. If one payment fails, others continue processing
  4. Status callbacks - Each payment sends its own callback as it completes

API Usage

The batch API uses the same PaymentOrder and Payment request bodies as the standard payment flow. If you’ve already integrated single payments, the structure will be familiar—batch payments simply wrap multiple entries into a single request.

When using batch payments we recommend that you generate and provide your own IDs for the Payments and PaymentOrders since they will be a part of the payment callback and are needed to identify the payment

Request Body

NameTypeRequiredDescription
batcharrayYesArray of batch entries
batch[].payment_orderobjectYesPayment order object. Same structure as Create Payment Order
batch[].paymentobjectYesPayment object. Same structure as Initiate Payment

Response Body

NameTypeDescription
idstringUUID of the created payment batch