Swish

Create Payment

schedule 8 min read

When initiating a payment process.

Edit "Create Payment" on GitHub

Create Payment

Within the swish part of the eCommerce API, you can create the following kind of payments:

  • Purchase

To create a swish payment, you perform an HTTP POST against the payments resource. The kind of payment created is indicated with the value of the operation field in the request.

Request

1
2
3
4
5
6
7
8
9
10
11
POST /psp/creditcard/payments HTTP/1.1
Host: api.externalintegration.payex.com
Authorization: Bearer <AccessToken>
Content-Type: application/json

{
    "payment": {
        "operation": "<operation>",
        "intent": "<intent>",
    }
}
Required Field Type Description
check payment object The payment object.
check └➔ operation string Determines the initial operation, that defines the type of payment created.

Purchase: Used to charge a card, an app or invoice the payer. It is followed by a Capture or Cancel operation.

Recur: Used to charge a card or invoice on a recurring basis. Is followed by a Capture or Cancel operation.

Payout: Used to deposit funds directly to the payer’s card. No more requests are necessary from the merchant side.

Verify. Used when verifying a card or invoice details without reserving funds. It is followed by a verification transaction.
check └➔ intent string The intent of the payment identifies how and when the charge will be effectuated. This determine the type transactions used during the payment process.

Authorization: Reserves the amount, and is followed by a Cancel or Capture of funds.

AutoCapture: A one phase-option which Captures funds automatically after authorization, or Sale, where the funds are drawn from an app or a bank account immediately upon completion.