Skip to main content
POST
/
orders
/
{id}
/
payment
curl --request POST \
  --url https://api.petstoreapi.com/v1/orders/{id}/payment \
  --header 'Content-Type: application/json' \
  --data '
{
  "amount": "49.99",
  "currency": "GBP",
  "source": {
    "object": "card",
    "name": "J. Doe",
    "number": "4242424242424242",
    "cvc": "123",
    "expMonth": 12,
    "expYear": 2025,
    "addressLine1": "123 Fake Street",
    "addressLine2": "4th Floor",
    "addressCity": "London",
    "addressCountry": "gb",
    "addressPostCode": "N12 9XX"
  }
}
'
{
"id": "2e3b4f5a-6b7c-8d9e-0f1a-2b3c4d5e6f7a",
"amount": "49.99",
"currency": "GBP",
"source": {
"object": "card",
"name": "J. Doe",
"number": "************4242",
"cvc": "123",
"expMonth": 12,
"expYear": 2025,
"addressCountry": "gb",
"addressPostCode": "N12 9XX"
},
"status": "succeeded"
}

Path Parameters

id
string<uuid>
required

Unique identifier for the order

Body

application/json

Order payment information with polymorphic payment sources

amount
string
required

Payment amount (positive decimal)

Examples:

"49.99"

"100.50"

currency
enum<string>
default:USD
required

Three-letter ISO 4217 currency code (uppercase)

Available options:
USD,
EUR,
GBP,
CAD,
AUD
source
Bank Card · object
required

Payment source (card or bank account)

Response

Payment successful

Order payment information with polymorphic payment sources

id
string<uuid>
required

Unique payment identifier

Example:

"2e3b4f5a-6b7c-8d9e-0f1a-2b3c4d5e6f7a"

amount
string
required

Payment amount (positive decimal)

Examples:

"49.99"

"100.50"

currency
enum<string>
default:USD
required

Three-letter ISO 4217 currency code (uppercase)

Available options:
USD,
EUR,
GBP,
CAD,
AUD
source
Bank Card · object
required

Payment source (card or bank account)

status
enum<string>
required

Payment status

Available options:
PENDING,
PROCESSING,
SUCCEEDED,
FAILED,
CANCELLED
createdAt
string<date-time>

Payment creation timestamp