Skip to main content
POST
Create a payment or deposit

Authorizations

x-spacepay-secret-key
string
header
required

Secret key for authentication of external API.

Body

application/json
currency
enum<string>
required

The currency of the payment. Only USD is supported.

Available options:
USD
Example:

"USD"

orderId
string
required

The order ID from the merchant

Maximum string length: 255
Example:

"Order_1234567890"

type
enum<string>
default:payment

Type of the payment. "payment" requires a fixed amount; "deposit" accepts any amount sent by the customer.

Available options:
payment,
deposit
amount
number

Payment amount in cents (e.g., 100 = $1.00). Required for type "payment", ignored for type "deposit". Minimum: 400 cents, Maximum: 100000000 cents.

Required range: 400 <= x <= 100000000
Example:

400

customerRefId
string

Stable customer identifier for deposits: the same value reuses the same deposit wallet across a customer's deposits (scoped to the merchant). Ignored for checkout (PAYMENT-type) payments.

Maximum string length: 255
Example:

"customer_42"

redirectUrl
string<uri>

URL to redirect the customer to after successful payment

Maximum string length: 2048
Example:

"https://merchant.example.com/checkout/success"

customMetadata
string

Arbitrary metadata to append to the redirect URL as a query string

Maximum string length: 2048
Example:

"{\"cartId\":\"abc123\",\"promo\":\"SUMMER24\"}"

Response

Payment created successfully

paymentUrl
string
required

URL of the payment screen where the customer can complete the payment

Example:

"https://spacepay.example.com/payment?paymentId=1234567890&secret=1234567890"

secret
string
required

Secret of the payment

Example:

"1234567890"

paymentId
string
required

Payment ID

Example:

"1234567890"

payment
object
required

Payment