Skip to content

Commit 4fd7569

Browse files
authored
Merge pull request #8 from benparj98/main
Add Twilio Pay creation samples
2 parents 92dc9f4 + 949b376 commit 4fd7569

File tree

6 files changed

+134
-0
lines changed

6 files changed

+134
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
curl -X POST 'https://content.twilio.com/v1/Content' \
2+
-H 'Content-Type: application/json' \
3+
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN \
4+
-d '{
5+
"friendly_name": "twilio_pay_order_details",
6+
"language": "en",
7+
"types": {
8+
"twilio/pay": {
9+
"payment_id": "12345",
10+
"body": "I am a pay template",
11+
"merchant_name": "Twilio",
12+
"country_code": "BR",
13+
"currency_code": "BRL",
14+
"items": "[{\"label\":\"Apple\",\"quantity\":\"1\",\"id\":\"apple\",\"amount\":\"3.00\"},{\"label\":\"Orange\",\"quantity\":\"1\",\"id\":\"apple\",\"amount\":\"2.99\"}]",
15+
"pix": {
16+
"type": "ORDER_DETAILS",
17+
"code": "insert pix code here",
18+
"key": "+5511968526123",
19+
"key_type": "PHONE"
20+
},
21+
"subtotal_amount": "5.99",
22+
"total_amount": "5.99",
23+
"order_expiration": "1743800292",
24+
"order_expiration_description": "Ends in 15 min"
25+
}
26+
}
27+
}'
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"title": "Content Templates API - Create Pay Order Details Template",
3+
"type": "server"
4+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"account_sid": "ACXXXXXXXXXXXXXXXXXXX",
3+
"date_created": "2025-04-07T23:21:27Z",
4+
"date_updated": "2025-04-07T23:21:27Z",
5+
"friendly_name": "twilio_pay_order_details",
6+
"language": "en",
7+
"links": {
8+
"approval_create": "https://content.twilio.com/v1/Content/HXXXXXXXXX/ApprovalRequests/whatsapp",
9+
"approval_fetch": "https://content.twilio.com/v1/Content/HXXXXXXXXX/ApprovalRequests"
10+
},
11+
"sid": "HXXXXXXXXX",
12+
"types": {
13+
"twilio/pay": {
14+
"body": "I am a pay template",
15+
"country_code": "BR",
16+
"currency_code": "BRL",
17+
"items": "[{\"label\":\"Apple\",\"quantity\":\"1\",\"id\":\"apple\",\"amount\":\"3.00\"},{\"label\":\"Orange\",\"quantity\":\"1\",\"id\":\"apple\",\"amount\":\"2.99\"}]",
18+
"merchant_identifier": null,
19+
"merchant_name": "Twilio",
20+
"order_expiration": "1743800292",
21+
"order_expiration_description": "Ends in 15 min",
22+
"payment_id": "12345",
23+
"payment_url": null,
24+
"pix": {
25+
"code": "insert pix code here",
26+
"key": "+5511968526123",
27+
"key_type": "PHONE",
28+
"status": null,
29+
"type": "ORDER_DETAILS"
30+
},
31+
"subtotal_amount": "5.99",
32+
"total_amount": "5.99",
33+
"total_label": null
34+
}
35+
},
36+
"url": "https://content.twilio.com/v1/Content/HXXXXXXXXX",
37+
"variables": {}
38+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
curl -X POST 'https://content.twilio.com/v1/Content' \
2+
-H 'Content-Type: application/json' \
3+
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN \
4+
-d '{
5+
"friendly_name": "twilio_pay_order_status",
6+
"language": "en",
7+
"types": {
8+
"twilio/pay": {
9+
"payment_id": "123451234512345",
10+
"body": "i am a {{1}} pay template",
11+
"merchant_name": "Twilio",
12+
"country_code": "BR",
13+
"currency_code": "BRL",
14+
"items": "[{\"label\":\"Apple\",\"quantity\":\"1\",\"id\":\"apple\",\"amount\":\"3.00\"},{\"label\":\"Orange\",\"quantity\":\"1\",\"id\":\"apple\",\"amount\":\"2.99\"}]",
15+
"pix": {
16+
"type": "ORDER_STATUS",
17+
"status": "processing"
18+
},
19+
"subtotal_amount": "5.99",
20+
"total_amount": "5.99"
21+
}
22+
}
23+
}'
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"title": "Content Templates API - Create Pay Order Status Template",
3+
"type": "server"
4+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"account_sid": "ACXXXXXXXXXXXX",
3+
"date_created": "2025-04-07T23:28:22Z",
4+
"date_updated": "2025-04-07T23:28:22Z",
5+
"friendly_name": "twilio_pay_order_status",
6+
"language": "en",
7+
"links": {
8+
"approval_create": "https://content.twilio.com/v1/Content/HX6ef38a5f4518c9bab2af102403de87b1/ApprovalRequests/whatsapp",
9+
"approval_fetch": "https://content.twilio.com/v1/Content/HX6ef38a5f4518c9bab2af102403de87b1/ApprovalRequests"
10+
},
11+
"sid": "HXXXXXXXXXXXX",
12+
"types": {
13+
"twilio/pay": {
14+
"body": "i am a {{1}} pay template",
15+
"country_code": "BR",
16+
"currency_code": "BRL",
17+
"items": "[{\"label\":\"Apple\",\"quantity\":\"1\",\"id\":\"apple\",\"amount\":\"3.00\"},{\"label\":\"Orange\",\"quantity\":\"1\",\"id\":\"apple\",\"amount\":\"2.99\"}]",
18+
"merchant_identifier": null,
19+
"merchant_name": "Twilio",
20+
"order_expiration": null,
21+
"order_expiration_description": null,
22+
"payment_id": "123451234512345",
23+
"payment_url": null,
24+
"pix": {
25+
"code": null,
26+
"key": null,
27+
"key_type": null,
28+
"status": "processing",
29+
"type": "ORDER_STATUS"
30+
},
31+
"subtotal_amount": "5.99",
32+
"total_amount": "5.99",
33+
"total_label": null
34+
}
35+
},
36+
"url": "https://content.twilio.com/v1/Content/HXXXXXXXXXX",
37+
"variables": {}
38+
}

0 commit comments

Comments
 (0)