Create charge session

Examples

Charge session potentially creating customer if not already exists.

curl -X POST \
  --url https://checkout-api.reepay.com/v1/session/charge \
  -u 'priv_xxxx:' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  --data '{
  "order": {
    "handle": "order-12345",
    "customer": {
        "handle": "customer-123",
        "first_name": "John",
        "last_name": "Doe",
        "phone":"+4531313131"
    },
    "amount": 50000
  },
  "accept_url":"https://webshop.com/accept/order-12345",
  "cancel_url":"https://webshop.com/decline/order-12345"
}'

Charge session also creating a saved payment method for later recurring use (e.g. for merchant initiated payments or as payment method on subscription). Currency definedmaybe different from account default.

curl -X POST \
  --url https://checkout-api.reepay.com/v1/session/charge \
  -u 'priv_xxxx:' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  --data '{
    "recurring": true,
    "order": {
        "ordertext": "Awesome product",
        "handle": "order-12345",
        "amount": 10000,
        "currency": "EUR",
        "customer":{
            "email":"[email protected]",
            "handle":"customer-1",
            "first_name":"John",
            "last_name":"Doe"
        }
    },
    "accept_url":"https://webshop.com/accept/order-12345",
    "cancel_url":"https://webshop.com/decline/order-12345"
}'

Errors

The operation can generate the following errors beside the generic HTTP error codes described here.

Error codeHTTP codeDescription
601400Could not find any available payments methods. Payment options must be configured in the administration to create a session
603404Configuration not found
604400Card-on-file not allowed for session storing credentials
79400Invoice already settled
105400Invoice already authorized
29400Invoice already cancelled
71400The customer is deleted
11400Duplicate customer handle provided
18400Customer could not be determined from either reference, create customer object or payment method source
99400Customer object given does not match handle of existing customer or handle given does not match existing customer reference
24400No amount or order lines was provided
100400Amount change is not allowed when charging an existing invoice
80400Existing charge has processing transactions
72400Currency change not allowed on existing invoice or charge
Language
Credentials
Basic
base64
:
Click Try It! to start a request and see the response here!