Add payment to cart - Fabric
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
cURL
Add payment to cart stripe
curl --request POST \
--url https://prod01-apigw.yourcompany.fabric.zone/api-payment/payment \
--header 'Content-Type: application/json' \
--data '
{
"cartId": "60b90dd7308ded0008ee3c5d",
"paymentDetails": {
"transactionDetails": {
"paymentType": "CARD_STRIPE",
"paymentToken": "token-ads8f97o234jk324"
},
"amount": 50.25,
"currency": "USD"
},
"billToAddress": {
"name": {
"first": "John",
"last": "Smith"
},
"email": "ohnsmith@gmail.com",
"phone": {
"number": "07780811973",
"kind": "mobile"
},
"street1": "600 Congress Ave",
"street2": "suite 219",
"city": "Austin",
"state": "Tx",
"country": "US",
"zipCode": "10033"
}
}
'
Response codes:
- 200
- 400
- 403
- 500
Example Response
{
"billToAddress": {
"name": {
"first": "John",
"last": "Smith"
},
"email": "user1@gmail.com",
"phone": {
"number": "3334445555",
"kind": "Mobile"
},
"street1": "1000 main street",
"city": "Seattle",
"state": "WA",
"country": "US",
"zipCode": "98101",
"street2": "1000 main street"
},
"_id": "5fee9d59f2f08a1b3cbdea08",
"createdAt": "2020-12-31T02:09:53.914Z",
"updatedAt": "2020-12-31T02:09:53.914Z",
"paymentDetails": {
"transactionDetails": {
"paymentType": "CARD_STRIPE",
"paymentToken": "pi_1IyMGc2YBvYaVyBQNkOiCE3E"
},
"paymentStatus": {
"cardHolderFullName": "First Last",
"paymentMethod": "visa",
"last4": "4242",
"amountCapturable": 99900,
"status": "succeeded"
},
"amount": 999,
"currency": "USD"
},
"version": 0,
"cartId": "60b90dd7308ded0008ee3c5d",
"isValid": true
}
Error Responses
{
"code": "<string>",
"message": "<string>"
}
{
"message": "Forbidden"
}
{
"code": "<string>",
"message": "<string>"
}
Headers
x-api-key
Type: string
Example:
"0LybWR49k95cCwYh3cu0waCYoh4H2Eux2J52wn4k"
Body
Type: application/json
cartId: string, required
- Required string length:
24
- Required string length:
paymentDetails: object, required
billToAddress: object, required
Response Structure
Success Response (200)
{
"billToAddress": {
"object attributes"
},
"_id": "<string>",
"createdAt": "<ISO8601 string>",
"updatedAt": "<ISO8601 string>",
"paymentDetails": {
"object attributes"
},
"version": <number>,
"cartId": "<string>",
"isValid": true
}
- isValid: boolean, Example:
true