POST
/
v1
/
payments
curl --request POST \
  --url https://api.stan-app.fr/v1/payments \
  --header 'Authorization: Basic <encoded-value>' \
  --header 'Content-Type: application/json' \
  --data '{
  "order_id": "<string>",
  "amount": 123,
  "subtotal_amount": 123,
  "shipping_amount": 123,
  "discount_amount": 123,
  "tax_amount": 123,
  "return_url": "<string>",
  "cancel_url": "<string>",
  "customer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "state": "<string>"
}'
{
  "payment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "state": "<string>",
  "redirect_url": "<string>"
}

Authorizations

Authorization
string
headerrequired

Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.

Body

application/json
order_id
string
required
amount
integer
required

Amount in cents

subtotal_amount
integer

The subtotal amount in cents. This amount is optionnal, it's useful to give information to the user.

shipping_amount
integer

The shipping cost in cents. This amount is optionnal, it's useful to give information to the user.

discount_amount
integer

The discount amount in cents. This amount is optionnal, it's useful to give information to the user.

tax_amount
integer

The tax amount in cents. This amount is optionnal, it's useful to give information to the user.

return_url
string
required

The return URL where the user will land after the payment has been complete. The URL will be appended with a URI query payment_status with the value corresponding to the Payment status and state with the value you provided in state.

cancel_url
string

The redirect URL used in case of payment cancel or fail.

customer_id
string

UUID of the customer

state
string

Payment state that will be used to preserve the state after the redirection to the provided return_url or cancel_url. If not state is provided Stan will generate one and transmit it to the return_url or cancel_url.

Response

200 - application/json
payment_id
string
state
string
redirect_url
string