跳到正文

Acme API v2024-06 is live — see the changelog for what changed.

Dashboard

Create a payment

POSThttps://api.acme.dev/v1/payments

Creates a payment and attempts to charge the given payment method. Use an Idempotency-Key header to safely retry.

认证

AuthorizationBearer

Use your secret key, e.g. sk_live_….

请求头

Idempotency-KeyUUID可选

A unique key to make the request idempotent.

请求

该接口需要一个对象。
amountinteger必填

Amount in the smallest currency unit.

currencystring必填

Three-letter ISO currency code.

customerstring可选

ID of an existing customer.

descriptionstring可选<=500 characters
metadatamap from strings to strings可选

Up to 50 key/value pairs.

payment_methodobject可选
typeenum必填
可选值:
tokenstring必填

Token from Acme.js.

响应

The created payment.
idstring可选
objectenum可选
可选值:
amountinteger可选
currencystring可选
statusenum可选

Lifecycle state of the payment.

可选值:
customerobject可选
idstring可选
emailemail可选
namestring可选
addressobject可选
line1string可选
citystring可选
countrystring可选
created_atdatetime可选
refundslist of objects可选
idstring可选
amountinteger可选

错误